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

ArrayTranslatorFieldsGroupsList.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\Core\Helper\FieldsGroups;
8
9 use Symfony\Component\Translation\TranslatorInterface;
10
17 final class ArrayTranslatorFieldsGroupsList implements FieldsGroupsList
18 {
20 private $groups;
21
23 private $defaultGroup;
24
26 private $translator;
27
28 public function __construct(TranslatorInterface $translator, $defaultGroup, array $groups)
29 {
30 $translatedGroups = [];
31 foreach ($groups as $groupIdentifier) {
32 $translatedGroups[$groupIdentifier] = $translator->trans($groupIdentifier, [], 'ezplatform_fields_groups');
33 }
34 $this->groups = $translatedGroups;
35 $this->defaultGroup = $defaultGroup;
36 $this->translator = $translator;
37 }
38
39 public function getGroups()
40 {
41 return $this->groups;
42 }
43
44 public function getDefaultGroup()
45 {
46 return $this->defaultGroup;
47 }
48 }
eZ\Publish\Core\Helper\FieldsGroups\ArrayTranslatorFieldsGroupsList
A fields groups list implementation based on settings (scalar values) injection.
Definition: ArrayTranslatorFieldsGroupsList.php:18
eZ\Publish\Core\Helper\FieldsGroups\ArrayTranslatorFieldsGroupsList\getDefaultGroup
getDefaultGroup()
Returns the default field group identifier.
Definition: ArrayTranslatorFieldsGroupsList.php:44
eZ\Publish\Core\Helper\FieldsGroups\ArrayTranslatorFieldsGroupsList\getGroups
getGroups()
Returns the list of fields groups.
Definition: ArrayTranslatorFieldsGroupsList.php:39
eZ\Publish\Core\Helper\FieldsGroups\ArrayTranslatorFieldsGroupsList\$defaultGroup
$defaultGroup
Definition: ArrayTranslatorFieldsGroupsList.php:23
eZ\Publish\Core\Helper\FieldsGroups\ArrayTranslatorFieldsGroupsList\__construct
__construct(TranslatorInterface $translator, $defaultGroup, array $groups)
Definition: ArrayTranslatorFieldsGroupsList.php:28
eZ\Publish\Core\Helper\FieldsGroups\ArrayTranslatorFieldsGroupsList\$translator
$translator
Definition: ArrayTranslatorFieldsGroupsList.php:26
eZ\Publish\Core\Helper\FieldsGroups\ArrayTranslatorFieldsGroupsList\$groups
$groups
Definition: ArrayTranslatorFieldsGroupsList.php:20
eZ\Publish\Core\Helper\FieldsGroups\FieldsGroupsList
List of content fields groups.
Definition: FieldsGroupsList.php:15
eZ\Publish\Core\Helper\FieldsGroups
Definition: ArrayTranslatorFieldsGroupsList.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.