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

MultiLanguageNameTrait.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\Core\Repository\Values;
8
12 trait MultiLanguageNameTrait
13 {
19 protected $names = [];
20
24 public function getNames()
25 {
26 return $this->names;
27 }
28
32 public function getName($languageCode = null)
33 {
34 if (!empty($languageCode)) {
35 return isset($this->names[$languageCode]) ? $this->names[$languageCode] : null;
36 }
37
38 foreach ($this->prioritizedLanguages as $prioritizedLanguageCode) {
39 if (isset($this->names[$prioritizedLanguageCode])) {
40 return $this->names[$prioritizedLanguageCode];
41 }
42 }
43
44 return isset($this->names[$this->mainLanguageCode])
45 ? $this->names[$this->mainLanguageCode]
46 : reset($this->names);
47 }
48 }
eZ\Publish\Core\Repository\Values\getNames
getNames()
{}
Definition: MultiLanguageNameTrait.php:24
eZ\Publish\Core\Repository\Values\getName
getName($languageCode=null)
{}
Definition: MultiLanguageNameTrait.php:32
eZ\Publish\Core\Repository\Values\MultiLanguageNameTrait
trait MultiLanguageNameTrait
Definition: MultiLanguageNameTrait.php:13
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.