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

ExternalStorageRegistryFactory.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\Core\Base\Container\ApiLoader\Storage;
8
9 use Symfony\Component\DependencyInjection\ContainerAwareInterface;
10 use Symfony\Component\DependencyInjection\ContainerAwareTrait;
11
12 class ExternalStorageRegistryFactory implements ContainerAwareInterface
13 {
14 use ContainerAwareTrait;
15
21 protected $externalStorages = [];
22
30 public function registerExternalStorageHandler($serviceId, $fieldTypeAlias)
31 {
32 $container = $this->container;
33 $this->externalStorages[$fieldTypeAlias] = function () use ($container, $serviceId) {
34 return $container->get($serviceId);
35 };
36 }
37
43 public function getExternalStorageHandlers()
44 {
45 return $this->externalStorages;
46 }
47
55 public function buildExternalStorageRegistry($externalStorageRegistryClass)
56 {
57 return new $externalStorageRegistryClass($this->getExternalStorageHandlers());
58 }
59 }
eZ\Publish\Core\Base\Container\ApiLoader\Storage\ExternalStorageRegistryFactory
Definition: ExternalStorageRegistryFactory.php:13
eZ\Publish\Core\Base\Container\ApiLoader\Storage\ExternalStorageRegistryFactory\$externalStorages
$externalStorages
Definition: ExternalStorageRegistryFactory.php:21
eZ\Publish\Core\Base\Container\ApiLoader\Storage\ExternalStorageRegistryFactory\buildExternalStorageRegistry
buildExternalStorageRegistry($externalStorageRegistryClass)
Returns external storage registry.
Definition: ExternalStorageRegistryFactory.php:55
eZ\Publish\Core\Base\Container\ApiLoader\Storage\ExternalStorageRegistryFactory\registerExternalStorageHandler
registerExternalStorageHandler($serviceId, $fieldTypeAlias)
Registers an external storage handler for a field type, identified by $fieldTypeAlias.
Definition: ExternalStorageRegistryFactory.php:30
eZ\Publish\Core\Base\Container\ApiLoader\Storage\ExternalStorageRegistryFactory\getExternalStorageHandlers
getExternalStorageHandlers()
Returns registered external storage handlers for field types (as closures to be lazy loaded in the pu...
Definition: ExternalStorageRegistryFactory.php:43
eZ\Publish\Core\Base\Container\ApiLoader\Storage
Definition: ExternalStorageRegistryFactory.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.