Navigation
eZ Documentation Center
 

This is outdated documentation made for eZ Publish Platform 5.2. It is being moved into the eZ Publish 5.x documentation, so please go there for most up-to-date documentation.

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Updated the exemples with "ContentTypeIdentifier( 'folder' )"

...

Code Block
languagephp
use eZ\Publish\API\Repository\Values\Content\Query\Criterion;
use eZ\Publish\API\Repository\Values\Content;
 
// [...]
 
$query = new Query();
$criterion1 = new Criterion\Subtree( $locationService->loadLocation( 2 )->pathString );
$criterion2 = new Criterion\ContentTypeIdContentTypeIdentifier( 1'folder' );
$query->criterion = new Criterion\LogicalAnd(
    array( $criterion1, $criterion2 )
);
 
$result = $searchService->findContent( $query );

...

Code Block
languagephp
use eZ\Publish\API\Repository\Values\Content\Query\Criterion;
use eZ\Publish\API\Repository\Values\Content;
 
// [...]
 
$query = new Query();
$query->criterion = new Criterion\LogicalAnd(
    array(
        new Criterion\ParentLocationId( 2 ),
        new Criterion\LogicalOr(
            array(
                new Criterion\ContentTypeIdContentTypeIdentifier( 1'folder' ),
                new Criterion\ContentTypeId( 2 )
            )
        )
    )
);
 
$result = $searchService->findContent( $query );

...