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

API/Repository/Values/Content/Query/Criterion/FullText.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
48 class FullText extends Criterion implements CustomFieldInterface
49 {
57 public $fuzziness = 1.;
58
74 public $boost = [];
75
83 public $analyzers;
84
92 public $wildcards;
93
99 protected $customFields = [];
100
101 public function __construct($value, array $properties = [])
102 {
103 parent::__construct(null, Operator::LIKE, $value);
104
105 // Assign additional properties, ugly but with the existing constructor
106 // API the only sensible way, I guess.
107 foreach ($properties as $name => $value) {
108 if (!isset($this->$name)) {
109 throw new \InvalidArgumentException("Unknown property $name.");
110 }
111
112 $this->$name = $value;
113 }
114 }
115
116 public function getSpecifications()
117 {
118 return [
119 new Specifications(Operator::LIKE, Specifications::FORMAT_SINGLE),
120 ];
121 }
122
126 public static function createFromQueryBuilder($target, $operator, $value)
127 {
128 @trigger_error('The ' . __METHOD__ . ' method is deprecated since version 7.2 and will be removed in 8.0.', E_USER_DEPRECATED);
129
130 return new self($value);
131 }
132
142 public function setCustomField($type, $field, $customField)
143 {
144 $this->customFields[$type][$field] = $customField;
145 }
146
157 public function getCustomField($type, $field)
158 {
159 if (!isset($this->customFields[$type]) ||
160 !isset($this->customFields[$type][$field])) {
161 return null;
162 }
163
164 return $this->customFields[$type][$field];
165 }
166 }
eZ\Publish\API\Repository\Values\Content\Query\Criterion\FullText
Full text search criterion.
Definition: API/Repository/Values/Content/Query/Criterion/FullText.php:49
eZ\Publish\API\Repository\Values\Content\Query\Criterion\FullText\getCustomField
getCustomField($type, $field)
Retun custom field.
Definition: API/Repository/Values/Content/Query/Criterion/FullText.php:157
eZ\Publish\API\Repository\Values\Content\Query\Criterion\FullText\$analyzers
$analyzers
Definition: API/Repository/Values/Content/Query/Criterion/FullText.php:83
eZ\Publish\API\Repository\Values\Content\Query\Criterion\FullText\setCustomField
setCustomField($type, $field, $customField)
Set a custom field to query.
Definition: API/Repository/Values/Content/Query/Criterion/FullText.php:142
eZ\Publish\API\Repository\Values\Content\Query\Criterion\FullText\__construct
__construct($value, array $properties=[])
Definition: API/Repository/Values/Content/Query/Criterion/FullText.php:101
eZ\Publish\API\Repository\Values\Content\Query\Criterion\FullText\$boost
$boost
Definition: API/Repository/Values/Content/Query/Criterion/FullText.php:74
eZ\Publish\API\Repository\Values\Content\Query\Criterion\FullText\$fuzziness
$fuzziness
Definition: API/Repository/Values/Content/Query/Criterion/FullText.php:57
eZ\Publish\API\Repository\Values\Content\Query\Criterion\FullText\$customFields
$customFields
Definition: API/Repository/Values/Content/Query/Criterion/FullText.php:99
eZ\Publish\API\Repository\Values\Content\Query\Criterion\FullText\createFromQueryBuilder
static createFromQueryBuilder($target, $operator, $value)
Definition: API/Repository/Values/Content/Query/Criterion/FullText.php:126
eZ\Publish\API\Repository\Values\Content\Query\Criterion\FullText\getSpecifications
getSpecifications()
Criterion description function.
Definition: API/Repository/Values/Content/Query/Criterion/FullText.php:116
eZ\Publish\API\Repository\Values\Content\Query\Criterion\FullText\$wildcards
$wildcards
Definition: API/Repository/Values/Content/Query/Criterion/FullText.php:92
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_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
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\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+.