Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

API/Repository/Values/Content/Query/Criterion/LanguageCode.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\API\Repository\Values\Content\Query\Criterion;
8
9 use eZ\Publish\API\Repository\Values\Content\Query\Criterion;
10 use eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator\Specifications;
11 use eZ\Publish\Core\Base\Exceptions\InvalidArgumentType;
12
20 class LanguageCode extends Criterion
21 {
27 public $matchAlwaysAvailable;
28
39 public function __construct($value, $matchAlwaysAvailable = true)
40 {
41 if (!is_bool($matchAlwaysAvailable)) {
42 throw new InvalidArgumentType('matchAlwaysAvailable', 'boolean', $matchAlwaysAvailable);
43 }
44
45 $this->matchAlwaysAvailable = $matchAlwaysAvailable;
46 parent::__construct(null, null, $value);
47 }
48
49 public function getSpecifications()
50 {
51 return [
52 new Specifications(
53 Operator::IN,
54 Specifications::FORMAT_ARRAY,
55 Specifications::TYPE_STRING
56 ),
57 new Specifications(
58 Operator::EQ,
59 Specifications::FORMAT_SINGLE,
60 Specifications::TYPE_STRING
61 ),
62 ];
63 }
64
68 public static function createFromQueryBuilder($target, $operator, $value)
69 {
70 @trigger_error('The ' . __METHOD__ . ' method is deprecated since version 7.2 and will be removed in 8.0.', E_USER_DEPRECATED);
71
72 return new self($value);
73 }
74 }
eZ\Publish\API\Repository\Values\Content\Query\Criterion\LanguageCode
A criterion that matches content based on its language code and always-available state.
Definition: API/Repository/Values/Content/Query/Criterion/LanguageCode.php:21
eZ\Publish\API\Repository\Values\Content\Query\Criterion\LanguageCode\$matchAlwaysAvailable
$matchAlwaysAvailable
Definition: API/Repository/Values/Content/Query/Criterion/LanguageCode.php:27
eZ\Publish\API\Repository\Values\Content\Query\Criterion\LanguageCode\__construct
__construct($value, $matchAlwaysAvailable=true)
Creates a new LanguageCode criterion.
Definition: API/Repository/Values/Content/Query/Criterion/LanguageCode.php:39
eZ\Publish\API\Repository\Values\Content\Query\Criterion\LanguageCode\getSpecifications
getSpecifications()
Criterion description function.
Definition: API/Repository/Values/Content/Query/Criterion/LanguageCode.php:49
eZ\Publish\API\Repository\Values\Content\Query\Criterion\LanguageCode\createFromQueryBuilder
static createFromQueryBuilder($target, $operator, $value)
Definition: API/Repository/Values/Content/Query/Criterion/LanguageCode.php:68
eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator\Specifications
This class is used by Criteria to describe which operators they support.
Definition: Specifications.php:15
eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator\Specifications\FORMAT_ARRAY
const FORMAT_ARRAY
Definition: Specifications.php:20
eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator\Specifications\TYPE_STRING
const TYPE_STRING
Definition: Specifications.php:27
eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator\Specifications\FORMAT_SINGLE
const FORMAT_SINGLE
Criterion input type description constants.
Definition: Specifications.php:19
eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator\EQ
const EQ
Definition: API/Repository/Values/Content/Query/Criterion/Operator.php:16
eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator\IN
const IN
Definition: API/Repository/Values/Content/Query/Criterion/Operator.php:21
eZ\Publish\API\Repository\Values\Content\Query\Criterion
Definition: API/Repository/Values/Content/Query/Criterion.php:15
eZ\Publish\API\Repository\Values\Content\Query\Criterion\$target
$target
Definition: API/Repository/Values/Content/Query/Criterion.php:35
eZ\Publish\API\Repository\Values\Content\Query\Criterion\$operator
$operator
Definition: API/Repository/Values/Content/Query/Criterion.php:21
eZ\Publish\API\Repository\Values\Content\Query\Criterion\$value
$value
Definition: API/Repository/Values/Content/Query/Criterion.php:28
eZ\Publish\Core\Base\Exceptions\InvalidArgumentType
Invalid Argument Type Exception implementation.
Definition: InvalidArgumentType.php:17
eZ\Publish\API\Repository\Values\Content\Query\Criterion
Definition: API/Repository/Values/Content/Query/Criterion/Ancestor.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.