kernel/private/api/content/criteria.php
Content list criteria mechanism.
- Copyright
- Copyright (C) 1999-2011 eZ Systems AS. All rights reserved.
- License
- eZ Business Use License Agreement Version 2.0
- Package
- API
- Version
- 4.6.0
\ezpContentCriteria
Package: API
This class is used to instantiate and manipulate content listing criterias.
Each returned criteria will have its own particular filtering methods, as seen in the example below
Example:
$criteria = new ezpContentCriteria();
$criteria->accept[] = ezpContentCriteria::location->subtree( ezpContentLocation::fromUrl( ‘/articles’ ) );
$criteria->accept[] = ezpContentCriteria::field( 'title' )->like( 'foo' );
$criteria->accept[] = ezpContentCriteria::field( 'summary' )->startsWith( 'abc' );
$criteria->deny[] = ezpContentCriteria::field( 'title' )->startsWith( 'excludedString' );
$articles = ezpRepository::query( $criteria )
Properties
Methods


__callStatic(
string $method, array $arguments
)
:
void
static
Static method magic method Handles requests for custom criteria
Parameters
Name | Type | Description |
---|---|---|
$method | string | Custom criteria name |
$arguments | array | Custom criteria arguments |


contentClass(
)
:
\ezpContentClassCriteria
static
Creates a content class criteria
Returns
Type | Description |
---|---|
\ezpContentClassCriteria |


custom(
string $method, $arguments
)
:
\ezpContentCriteriaInterface
static
Custom criteria factory.
Parameters
Returns
Details
Name | Type | Description |
---|---|---|
$method | string | |
$arguments |
Type | Description |
---|---|
\ezpContentCriteriaInterface |
- Note
- This is a PHP < 5.3 replacement for __callStatic. Use the static call if you use PHP 5.3+


depth(
int $depth
=
1
)
:
void
static
Creates a depth criteria
Parameters
Name | Type | Description |
---|---|---|
$depth | int | The maximum level of depth that should be explored (1 by default) |


field(
mixed $fieldIdentifier
)
:
\ezpContentFieldCriteria
static
Creates a field criteria
Parameters
Returns
Name | Type | Description |
---|---|---|
$fieldIdentifier | mixed |
Type | Description |
---|---|
\ezpContentFieldCriteria |


limit(
)
:
\ezpContentLimitCriteria
static
Creates a limit criteria
Returns
Type | Description |
---|---|
\ezpContentLimitCriteria |


location(
)
:
\ezpContentLocationCriteria
static
Creates a location criteria
Returns
Type | Description |
---|---|
\ezpContentLocationCriteria |


sorting(
string $sortKey, $sortOrder
)
:
\ezpContentSortingCriteria
static
Creates a sorting criteria
Parameters
Returns
Name | Type | Description |
---|---|---|
$sortKey | string | The sort key. Only non-attribute keys are supported (see {@link http://goo.gl/xvJMM}) |
$sortOrder |
Type | Description |
---|---|
\ezpContentSortingCriteria |