Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-21608

Criterion a a part of Query object is not handled as optional

    XMLWordPrintable

Details

    Description

      Though it is not marked as required, Criterion a a part of Query object not being handled as optional, which makes some things awkward and inefficient.
      For example to fetch a list of 10 last published Content now we have to use something like:

      new Query(
          array(
              'criterion'   => new Criterion\LogicalNot( new Criterion\ContentId( array( 0 ) ) ),
              'offset'      => 0,
              'limit'       => 10,
              'sortClauses' => array(
                  new SortClause\DatePublished(),
              )
          )
      )
      

      While it would be more efficient and natural to just have:

      new Query(
          array(
              'criterion'   => null,// or omit this line altogether
              'offset'      => 0,
              'limit'       => 10,
              'sortClauses' => array(
                  new SortClause\DatePublished(),
              )
          )
      )
      

      Both Legacy and Solr storage gateways need to be updated to handle this change.

      We should also document in API Query class that $criterion property is optional and what it means if it is not provided.
      Also, SPI SearchHandler::findContent() should document for implementers that null as criterion needs to be handled.

      Attachments

        Activity

          People

            Unassigned Unassigned
            petar.spanja-obsolete@ez.no Petar Spanja (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: