for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* File containing the eZ\Publish\API\Repository\Values\Content\Query\Criterion\ParentLocationId class.
*
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
namespace eZ\Publish\API\Repository\Values\Content\Query\Criterion;
use eZ\Publish\API\Repository\Values\Content\Query\Criterion;
use eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator\Specifications;
* A criterion that matches content based on its parent location id.
* Own location id is done using {@see LocationId}
* Supported operators:
* - IN: matches against a list of location ids
* - EQ: matches against a unique location id
class ParentLocationId extends Criterion
{
* Creates a new ParentLocationId criterion.
* @param int|int[] $value One or more locationId parent locations must be matched against
* @throws \InvalidArgumentException if a non numeric id is given
* @throws \InvalidArgumentException if the value type doesn't match the operator
public function __construct($value)
parent::__construct(null, null, $value);
}
public function getSpecifications()
return [
new Specifications(
Operator::IN,
Specifications::FORMAT_ARRAY,
Specifications::TYPE_INTEGER | Specifications::TYPE_STRING
),
Operator::EQ,
Specifications::FORMAT_SINGLE,
];