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

AssetFactory.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Bundle\EzPublishCoreBundle\Assetic;
8
9 use eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\SiteAccessAware\DynamicSettingParserInterface;
10 use eZ\Publish\Core\MVC\ConfigResolverInterface;
11 use Symfony\Bundle\AsseticBundle\Factory\AssetFactory as BaseAssetFactory;
12
13 class AssetFactory extends BaseAssetFactory
14 {
16 private $configResolver;
17
19 private $dynamicSettingParser;
20
21 public function setConfigResolver(ConfigResolverInterface $configResolver)
22 {
23 $this->configResolver = $configResolver;
24 }
25
26 public function setDynamicSettingParser(DynamicSettingParserInterface $dynamicSettingParser)
27 {
28 $this->dynamicSettingParser = $dynamicSettingParser;
29 }
30
36 protected function parseInput($input, array $options = [])
37 {
38 if ($this->dynamicSettingParser->isDynamicSetting($input)) {
39 $parsedSettings = $this->dynamicSettingParser->parseDynamicSetting($input);
40 $input = $this->configResolver->getParameter(
41 $parsedSettings['param'],
42 $parsedSettings['namespace'],
43 $parsedSettings['scope']
44 );
45
46 if (is_array($input)) {
47 $collection = $this->createAssetCollection([], $options);
48 foreach ($input as $file) {
49 $collection->add(parent::parseInput($file, $options));
50 }
51
52 return $collection;
53 }
54 }
55
56 return parent::parseInput($input, $options);
57 }
58 }
eZ\Bundle\EzPublishCoreBundle\Assetic\AssetFactory
Definition: AssetFactory.php:14
eZ\Bundle\EzPublishCoreBundle\Assetic\AssetFactory\setDynamicSettingParser
setDynamicSettingParser(DynamicSettingParserInterface $dynamicSettingParser)
Definition: AssetFactory.php:26
eZ\Bundle\EzPublishCoreBundle\Assetic\AssetFactory\$configResolver
$configResolver
Definition: AssetFactory.php:16
eZ\Bundle\EzPublishCoreBundle\Assetic\AssetFactory\$dynamicSettingParser
$dynamicSettingParser
Definition: AssetFactory.php:19
eZ\Bundle\EzPublishCoreBundle\Assetic\AssetFactory\setConfigResolver
setConfigResolver(ConfigResolverInterface $configResolver)
Definition: AssetFactory.php:21
eZ\Bundle\EzPublishCoreBundle\Assetic\AssetFactory\parseInput
parseInput($input, array $options=[])
Adds dynamic settings notation support: $<paramName>[;<namespace>[;<scope>]]$.
Definition: AssetFactory.php:36
eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\SiteAccessAware\DynamicSettingParserInterface
Interface for dynamic setting parsers.
Definition: DynamicSettingParserInterface.php:26
eZ\Publish\Core\MVC\ConfigResolverInterface
Interface for config resolvers.
Definition: ConfigResolverInterface.php:19
eZ\Bundle\EzPublishCoreBundle\Assetic
Definition: AssetFactory.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.