eZPublishCommunityProject  2013.4
eZ\Publish\API\Repository\Values\Content\Query\Criterion\DateMetadata Class Reference

A criterion that matches content based on one of the date metadata (created or modified) More...

+ Inheritance diagram for eZ\Publish\API\Repository\Values\Content\Query\Criterion\DateMetadata:
+ Collaboration diagram for eZ\Publish\API\Repository\Values\Content\Query\Criterion\DateMetadata:

Public Member Functions

 __construct ($target, $operator, $value)
 Creates a new DateMetadata criterion on $metadata. More...
 
 getSpecifications ()
 Criterion description function. More...
 
- Public Member Functions inherited from eZ\Publish\API\Repository\Values\Content\Query\Criterion
 __construct ($target, $operator, $value)
 Performs operator validation based on the Criterion specifications returned by {. More...
 

Public Attributes

const CREATED = 'created'
 DateMetadata target: creation date. More...
 
const MODIFIED = 'modified'
 DateMetadata target: modification date. More...
 
- Public Attributes inherited from eZ\Publish\API\Repository\Values\Content\Query\Criterion
 $operator
 
 $target
 
 $value
 

Additional Inherited Members

- Static Public Member Functions inherited from eZ\Publish\API\Repository\Values\Content\Query\Criterion
static createFromQueryBuilder ($target, $operator, $value)
 
- Static Public Member Functions inherited from eZ\Publish\API\Repository\Values\Content\Query\CriterionInterface
static createFromQueryBuilder ($target, $operator, $value)
 Creates a new Criterion for $target with operator $operator on $value. More...
 

Detailed Description

A criterion that matches content based on one of the date metadata (created or modified)

Supported Operators: EQ, IN: matches content whose date is or belongs to a list of timestamps GT, GTE: matches content whose date is greater than/greater than or equals the given timestamp LT, LTE: matches content whose date is lower than/lower than or equals the given timestamp BETWEEN: matches content whose date is between (included) the TWO given timestamps

Example: $createdCriterion = new Criterion( Criterion::CREATED, Operator::GTE, strtotime( 'yesterday' ) );

Constructor & Destructor Documentation

eZ\Publish\API\Repository\Values\Content\Query\Criterion\DateMetadata::__construct (   $target,
  $operator,
  $value 
)

Creates a new DateMetadata criterion on $metadata.

Exceptions
\InvalidArgumentExceptionIf target is unknown
Parameters
string$targetOne of DateMetadata::CREATED or DateMetadata::MODIFIED
string$operatorOne of the Operator constants
mixed$valueThe match value, either as an array of as a single value, depending on the operator

Member Function Documentation

eZ\Publish\API\Repository\Values\Content\Query\Criterion\DateMetadata::getSpecifications ( )

Criterion description function.

Returns the combination of the Criterion's supported operator/value, as an array of eZ objects

  • Operator is one supported Operator, as an Operator::* constant
  • ValueType is the type of input value this operator requires, either array or single
  • SupportedTypes is an array of types the operator will accept
  • ValueCountLimitation is an integer saying how many values are expected.

// IN and EQ are supported return array( // The EQ operator expects a single value, either as an integer or a string new Specifications( Operator::EQ, Specifications::INPUT_TYPE_SINGLE, array( Specifications::INPUT_VALUE_INTEGER, Specifications::INPUT_VALUE_STRING ), ), // The IN operator expects an array of values, of either integers or strings new Specifications( Operator::IN, Specifications::INPUT_TYPE_ARRAY, array( Specifications::INPUT_VALUE_INTEGER, Specifications::INPUT_VALUE_STRING ) ) )*

Returns
[]

Implements eZ\Publish\API\Repository\Values\Content\Query\CriterionInterface.

Member Data Documentation

const eZ\Publish\API\Repository\Values\Content\Query\Criterion\DateMetadata::CREATED = 'created'

DateMetadata target: creation date.

const eZ\Publish\API\Repository\Values\Content\Query\Criterion\DateMetadata::MODIFIED = 'modified'

DateMetadata target: modification date.


The documentation for this class was generated from the following file: