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

FieldTypesTranslationExtractor.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\Core\MVC\Symfony\Translation;
8
9 use eZ\Publish\Core\Base\Container\ApiLoader\FieldTypeCollectionFactory;
10 use JMS\TranslationBundle\Model\Message;
11 use JMS\TranslationBundle\Model\MessageCatalogue;
12 use JMS\TranslationBundle\Translation\ExtractorInterface;
13
17 class FieldTypesTranslationExtractor implements ExtractorInterface
18 {
19 private $fieldTypeCollectionFactory;
20
21 public function __construct(FieldTypeCollectionFactory $fieldTypeCollectionFactory)
22 {
23 $this->fieldTypeCollectionFactory = $fieldTypeCollectionFactory;
24 }
25
26 public function extract()
27 {
28 $catalogue = new MessageCatalogue();
29 foreach ($this->fieldTypeCollectionFactory->getConcreteFieldTypesIdentifiers() as $fieldTypeIdentifier) {
30 $catalogue->add(
31 new Message(
32 $fieldTypeIdentifier . '.name',
33 'fieldtypes'
34 )
35 );
36 }
37
38 return $catalogue;
39 }
40 }
eZ\Publish\Core\Base\Container\ApiLoader\FieldTypeCollectionFactory
Definition: FieldTypeCollectionFactory.php:13
eZ\Publish\Core\MVC\Symfony\Translation\FieldTypesTranslationExtractor
Generates translation strings for fieldtypes names (<FieldTypeIdentifier>.name).
Definition: FieldTypesTranslationExtractor.php:18
eZ\Publish\Core\MVC\Symfony\Translation\FieldTypesTranslationExtractor\extract
extract()
Definition: FieldTypesTranslationExtractor.php:26
eZ\Publish\Core\MVC\Symfony\Translation\FieldTypesTranslationExtractor\__construct
__construct(FieldTypeCollectionFactory $fieldTypeCollectionFactory)
Definition: FieldTypesTranslationExtractor.php:21
eZ\Publish\Core\MVC\Symfony\Translation\FieldTypesTranslationExtractor\$fieldTypeCollectionFactory
$fieldTypeCollectionFactory
Definition: FieldTypesTranslationExtractor.php:19
eZ\Publish\Core\MVC\Symfony\Translation
Definition: CatalogueMapperFileWriter.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.