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

Core/FieldType/Author/Value.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\Core\FieldType\Author;
8
9 use eZ\Publish\Core\FieldType\Value as BaseValue;
10
14 class Value extends BaseValue
15 {
21 public $authors;
22
28 public function __construct(array $authors = [])
29 {
30 $this->authors = new AuthorCollection($authors);
31 }
32
36 public function __toString()
37 {
38 if (empty($this->authors)) {
39 return '';
40 }
41
42 $authorNames = [];
43
44 if ($this->authors instanceof AuthorCollection) {
45 foreach ($this->authors as $author) {
46 $authorNames[] = $author->name;
47 }
48 }
49
50 return implode(', ', $authorNames);
51 }
52 }
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\Author\AuthorCollection
Author collection.
Definition: AuthorCollection.php:17
eZ\Publish\Core\FieldType\Author\Value\__construct
__construct(array $authors=[])
Construct a new Value object and initialize with $authors.
Definition: Core/FieldType/Author/Value.php:28
eZ\Publish\Core\FieldType\Author\Value\$authors
$authors
Definition: Core/FieldType/Author/Value.php:21
eZ\Publish\Core\FieldType\Author\Value\__toString
__toString()
Definition: Core/FieldType/Author/Value.php:36
eZ\Publish\Core\FieldType\Value
Abstract class for all field value classes.
Definition: Core/FieldType/Value.php:17
eZ\Publish\Core\FieldType\Author
Definition: Author.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.