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

Core/FieldType/Keyword/Value.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\Core\FieldType\Keyword;
8
9 use eZ\Publish\Core\FieldType\Value as BaseValue;
10
14 class Value extends BaseValue
15 {
21 public $values = [];
22
28 public function __construct($values = null)
29 {
30 if ($values !== null) {
31 if (!is_array($values)) {
32 $tags = [];
33 foreach (explode(',', $values) as $tag) {
34 $tag = trim($tag);
35 if ($tag) {
36 $tags[] = $tag;
37 }
38 }
39 $values = $tags;
40 }
41
42 $this->values = array_unique($values);
43 }
44 }
45
51 public function __toString()
52 {
53 return implode(', ', $this->values);
54 }
55 }
eZ\Publish\API\Repository\Values\Content\Query\Criterion\Value
Struct that stores extra value information for a Criterion object.
Definition: API/Repository/Values/Content/Query/Criterion/Value.php:13
eZ\Publish\Core\FieldType\Keyword\Value\$values
$values
Definition: Core/FieldType/Keyword/Value.php:21
eZ\Publish\Core\FieldType\Keyword\Value\__toString
__toString()
Returns a string representation of the keyword value.
Definition: Core/FieldType/Keyword/Value.php:51
eZ\Publish\Core\FieldType\Keyword\Value\__construct
__construct($values=null)
Construct a new Value object and initialize with $values.
Definition: Core/FieldType/Keyword/Value.php:28
eZ\Publish\Core\FieldType\Value
Abstract class for all field value classes.
Definition: Core/FieldType/Value.php:17
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.