![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/magento/module-theme/Model/ResourceModel/Design/Config/ |
<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\Theme\Model\ResourceModel\Design\Config; use Magento\Config\Model\ResourceModel\Config\Data\Collection as ConfigCollection; use Magento\Framework\Data\Collection\Db\FetchStrategyInterface; use Magento\Framework\Data\Collection\EntityFactoryInterface; use Magento\Framework\DB\Adapter\AdapterInterface; use Magento\Framework\Event\ManagerInterface; use Magento\Framework\Model\ResourceModel\Db\AbstractDb; use Magento\Theme\Model\Design\Config\ValueProcessor; use Psr\Log\LoggerInterface; class Collection extends ConfigCollection { /** * @var \Magento\Theme\Model\Design\Config\ValueProcessor */ protected $valueProcessor; /** * @param EntityFactoryInterface $entityFactory * @param LoggerInterface $logger * @param FetchStrategyInterface $fetchStrategy * @param ManagerInterface $eventManager * @param ValueProcessor $valueProcessor * @param AdapterInterface|null $connection * @param AbstractDb|null $resource */ public function __construct( EntityFactoryInterface $entityFactory, LoggerInterface $logger, FetchStrategyInterface $fetchStrategy, ManagerInterface $eventManager, ValueProcessor $valueProcessor, AdapterInterface $connection = null, AbstractDb $resource = null ) { $this->valueProcessor = $valueProcessor; parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource); } /** * Add paths filter to collection * * @param array $paths * @return $this */ public function addPathsFilter(array $paths) { $this->addFieldToFilter('path', ['in' => $paths]); return $this; } /** * Add scope ID filter to collection * * @param int $scopeId * @return $this */ public function addScopeIdFilter($scopeId) { $this->addFieldToFilter('scope_id', (int)$scopeId); return $this; } /** * @inheritDoc */ protected function _afterLoad() { foreach ($this->_items as $item) { $item->setData( 'value', $this->valueProcessor->process( $item->getData('value'), $item->getData('scope'), $item->getData('scope_id'), $item->getData('path') ) ); } return parent::_afterLoad(); } }