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

API/Repository/Values/Content/Query/Criterion/Field.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\API\Repository\Values\Content\Query\CustomFieldInterface;
12
18 class Field extends Criterion implements CustomFieldInterface
19 {
25 protected $customFields = [];
26
27 public function getSpecifications()
28 {
29 return [
30 new Specifications(Operator::IN, Specifications::FORMAT_ARRAY),
31 new Specifications(Operator::EQ, Specifications::FORMAT_SINGLE),
32 new Specifications(Operator::GT, Specifications::FORMAT_SINGLE),
33 new Specifications(Operator::GTE, Specifications::FORMAT_SINGLE),
34 new Specifications(Operator::LT, Specifications::FORMAT_SINGLE),
35 new Specifications(Operator::LTE, Specifications::FORMAT_SINGLE),
36 new Specifications(Operator::LIKE, Specifications::FORMAT_SINGLE),
37 new Specifications(Operator::BETWEEN, Specifications::FORMAT_ARRAY, null, 2),
38 new Specifications(Operator::CONTAINS, Specifications::FORMAT_SINGLE),
39 ];
40 }
41
51 public function setCustomField($type, $field, $customField)
52 {
53 $this->customFields[$type][$field] = $customField;
54 }
55
66 public function getCustomField($type, $field)
67 {
68 if (!isset($this->customFields[$type]) ||
69 !isset($this->customFields[$type][$field])) {
70 return null;
71 }
72
73 return $this->customFields[$type][$field];
74 }
75 }
eZ\Publish\API\Repository\Values\Content\Query\Criterion\Field
The Field Criterion class.
Definition: API/Repository/Values/Content/Query/Criterion/Field.php:19
eZ\Publish\API\Repository\Values\Content\Query\Criterion\Field\$customFields
$customFields
Definition: API/Repository/Values/Content/Query/Criterion/Field.php:25
eZ\Publish\API\Repository\Values\Content\Query\Criterion\Field\getSpecifications
getSpecifications()
Criterion description function.
Definition: API/Repository/Values/Content/Query/Criterion/Field.php:27
eZ\Publish\API\Repository\Values\Content\Query\Criterion\Field\getCustomField
getCustomField($type, $field)
Return custom field.
Definition: API/Repository/Values/Content/Query/Criterion/Field.php:66
eZ\Publish\API\Repository\Values\Content\Query\Criterion\Field\setCustomField
setCustomField($type, $field, $customField)
Set a custom field to query.
Definition: API/Repository/Values/Content/Query/Criterion/Field.php:51
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\FORMAT_SINGLE
const FORMAT_SINGLE
Criterion input type description constants.
Definition: Specifications.php:19
eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator\LIKE
const LIKE
Does a lookup where a the value can contain a "*" (a wildcard) in order to match a pattern.
Definition: API/Repository/Values/Content/Query/Criterion/Operator.php:29
eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator\LT
const LT
Definition: API/Repository/Values/Content/Query/Criterion/Operator.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\LTE
const LTE
Definition: API/Repository/Values/Content/Query/Criterion/Operator.php:20
eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator\GT
const GT
Definition: API/Repository/Values/Content/Query/Criterion/Operator.php:17
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\Operator\BETWEEN
const BETWEEN
Definition: API/Repository/Values/Content/Query/Criterion/Operator.php:22
eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator\CONTAINS
const CONTAINS
Definition: API/Repository/Values/Content/Query/Criterion/Operator.php:30
eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator\GTE
const GTE
Definition: API/Repository/Values/Content/Query/Criterion/Operator.php:18
eZ\Publish\API\Repository\Values\Content\Query\Criterion
Definition: API/Repository/Values/Content/Query/Criterion.php:15
eZ\Publish\API\Repository\Values\Content\Query\CustomFieldInterface
Interface for criteria and sort clauses, which defines a custom field mapping.
Definition: CustomFieldInterface.php:18
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+.