示例#1
0
 /**
  * @param \Magento\Customer\Model\Address\Config\Reader $reader
  * @param \Magento\Framework\Config\CacheInterface $cache
  * @param \Magento\Store\Model\StoreManagerInterface $storeManager
  * @param \Magento\Customer\Helper\Address $addressHelper
  * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
  * @param string $cacheId
  */
 public function __construct(\Magento\Customer\Model\Address\Config\Reader $reader, \Magento\Framework\Config\CacheInterface $cache, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Customer\Helper\Address $addressHelper, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, $cacheId = 'address_format')
 {
     parent::__construct($reader, $cache, $cacheId);
     $this->_storeManager = $storeManager;
     $this->_addressHelper = $addressHelper;
     $this->_scopeConfig = $scopeConfig;
 }
示例#2
0
 /**
  * @param \Magento\Framework\Mview\Config\Reader $reader
  * @param \Magento\Framework\Config\CacheInterface $cache
  * @param \Magento\Framework\Mview\View\State\CollectionInterface $stateCollection
  * @param string $cacheId
  */
 public function __construct(\Magento\Framework\Mview\Config\Reader $reader, \Magento\Framework\Config\CacheInterface $cache, \Magento\Framework\Mview\View\State\CollectionInterface $stateCollection, $cacheId = 'mview_config')
 {
     $this->stateCollection = $stateCollection;
     $isCacheExists = $cache->test($cacheId);
     parent::__construct($reader, $cache, $cacheId);
     if (!$isCacheExists) {
         $this->deleteNonexistentStates();
     }
 }
示例#3
0
 /**
  * @param \Magento\Indexer\Model\Config\Reader $reader
  * @param \Magento\Framework\Config\CacheInterface $cache
  * @param \Magento\Indexer\Model\Resource\Indexer\State\Collection $stateCollection
  * @param string $cacheId
  */
 public function __construct(\Magento\Indexer\Model\Config\Reader $reader, \Magento\Framework\Config\CacheInterface $cache, \Magento\Indexer\Model\Resource\Indexer\State\Collection $stateCollection, $cacheId = 'indexer_config')
 {
     $this->stateCollection = $stateCollection;
     $isCacheExists = $cache->test($cacheId);
     parent::__construct($reader, $cache, $cacheId);
     if (!$isCacheExists) {
         $this->deleteNonexistentStates();
     }
 }
示例#4
0
 /**
  * Return analysis config by language.
  *
  * @param string $language A language code (eg: en, fr, ...).
  * @param mixed  $default  Default value if no config is found.
  *
  * @return mixed
  */
 public function get($language = null, $default = null)
 {
     if ($language === null) {
         $language = 'default';
     }
     $data = parent::get($language, null);
     if ($data === null) {
         $data = $this->get('default', $default);
     }
     return $data;
 }
示例#5
0
 /**
  * @param \Magento\Catalog\Model\ProductOptions\Config\Reader $reader
  * @param \Magento\Framework\Config\CacheInterface $cache
  * @param string $cacheId
  */
 public function __construct(\Magento\Catalog\Model\ProductOptions\Config\Reader $reader, \Magento\Framework\Config\CacheInterface $cache, $cacheId = 'product_options_config')
 {
     parent::__construct($reader, $cache, $cacheId);
 }
示例#6
0
 /**
  * Constructor.
  *
  * @param Reader                 $reader        Config file reader.
  * @param CacheInterface         $cache         Cache interface.
  * @param IndexSettingsInterface $indexSettings Index settings.
  * @param string                 $cacheId       Config cache id.
  */
 public function __construct(Reader $reader, CacheInterface $cache, IndexSettingsInterface $indexSettings, $cacheId = self::CACHE_ID)
 {
     parent::__construct($reader, $cache, $cacheId);
     $this->indexSettings = $indexSettings;
     $this->addMappings();
 }
 public function testGetTotals()
 {
     $configuration = ['total1' => ['title' => 'Title1'], 'total2' => ['title' => 'Title2']];
     $this->_dataStorage->expects($this->once())->method('get')->with('totals', [])->will($this->returnValue($configuration));
     $this->assertSame($configuration, $this->_model->getTotals());
 }
示例#8
0
 /**
  * @param \Magento\Framework\Search\Request\Config\FilesystemReader $reader
  * @param \Magento\Framework\Config\CacheInterface $cache
  * @param string $cacheId
  */
 public function __construct(\Magento\Framework\Search\Request\Config\FilesystemReader $reader, \Magento\Framework\Config\CacheInterface $cache, $cacheId = self::CACHE_ID)
 {
     parent::__construct($reader, $cache, $cacheId);
 }
示例#9
0
 /**
  * Initialize dependencies.
  *
  * @param \Magento\Framework\Communication\Config\Reader\XmlReader $reader
  * @param \Magento\Framework\Config\CacheInterface $cache
  * @param \Magento\Framework\Communication\Config\Reader\EnvReader $envReader
  * @param string $cacheId
  */
 public function __construct(\Magento\Framework\Communication\Config\Reader\XmlReader $reader, \Magento\Framework\Config\CacheInterface $cache, \Magento\Framework\Communication\Config\Reader\EnvReader $envReader, $cacheId = 'communication_config_cache')
 {
     parent::__construct($reader, $cache, $cacheId);
     $this->merge($envReader->read());
 }
示例#10
0
 /**
  * @param \Magento\Directory\Model\Country\Postcode\Config\Reader $reader
  * @param \Magento\Framework\Config\CacheInterface $cache
  */
 public function __construct(\Magento\Directory\Model\Country\Postcode\Config\Reader $reader, \Magento\Framework\Config\CacheInterface $cache)
 {
     parent::__construct($reader, $cache, 'country_postcodes');
 }
示例#11
0
文件: Data.php 项目: aiesh/magento2
 /**
  * Initialize parameters
  *
  * @param \Magento\Cron\Model\Config\Reader\Xml $reader
  * @param \Magento\Framework\Config\CacheInterface        $cache
  * @param \Magento\Cron\Model\Config\Reader\Db  $dbReader
  * @param string                               $cacheId
  */
 public function __construct(\Magento\Cron\Model\Config\Reader\Xml $reader, \Magento\Framework\Config\CacheInterface $cache, \Magento\Cron\Model\Config\Reader\Db $dbReader, $cacheId = 'crontab_config_cache')
 {
     parent::__construct($reader, $cache, $cacheId);
     $this->merge($dbReader->get());
 }
示例#12
0
文件: Data.php 项目: aiesh/magento2
 /**
  * @param \Magento\Cron\Model\Groups\Config\Reader\Xml $reader
  * @param \Magento\Framework\Config\CacheInterface $cache
  * @param string $cacheId
  */
 public function __construct(\Magento\Cron\Model\Groups\Config\Reader\Xml $reader, \Magento\Framework\Config\CacheInterface $cache, $cacheId = 'cron_groups_config_cache')
 {
     parent::__construct($reader, $cache, $cacheId);
 }
示例#13
0
 /**
  * @param \Magento\Framework\Config\ReaderInterface $reader
  * @param \Magento\Framework\Config\CacheInterface $cache
  * @param string $cacheId
  */
 public function __construct(\Magento\Framework\Config\ReaderInterface $reader, \Magento\Framework\Config\CacheInterface $cache, $cacheId = 'request_declaration')
 {
     parent::__construct($reader, $cache, $cacheId);
 }
示例#14
0
 /**
  * @param \Magento\Email\Model\Template\Config\Reader $reader
  * @param \Magento\Framework\Config\CacheInterface $cache
  */
 public function __construct(\Magento\Email\Model\Template\Config\Reader $reader, \Magento\Framework\Config\CacheInterface $cache)
 {
     parent::__construct($reader, $cache, 'email_templates');
 }
示例#15
0
 public function __construct(\Ktpl\Test\Model\Config\Reader $reader, \Magento\Framework\Config\CacheInterface $cache, $cacheId = 'ktpl_test_config')
 {
     parent::__construct($reader, $cache, $cacheId);
 }
示例#16
0
 /**
  * Initialize reader and cache.
  *
  * @param Reader $reader
  * @param CacheInterface $cache
  */
 public function __construct(Reader $reader, CacheInterface $cache)
 {
     parent::__construct($reader, $cache, self::CACHE_ID);
 }
示例#17
0
文件: Data.php 项目: aiesh/magento2
 /**
  * @param \Magento\Sales\Model\Config\Reader $reader
  * @param \Magento\Framework\Config\CacheInterface $cache
  * @param string $cacheId
  */
 public function __construct(\Magento\Sales\Model\Config\Reader $reader, \Magento\Framework\Config\CacheInterface $cache, $cacheId = 'sales_totals_config_cache')
 {
     parent::__construct($reader, $cache, $cacheId);
 }
示例#18
0
 /**
  * @param \Magento\ImportExport\Model\Export\Config\Reader $reader
  * @param \Magento\Framework\Config\CacheInterface $cache
  * @param string $cacheId
  */
 public function __construct(\Magento\ImportExport\Model\Export\Config\Reader $reader, \Magento\Framework\Config\CacheInterface $cache, $cacheId = 'export_config_cache')
 {
     parent::__construct($reader, $cache, $cacheId);
 }
示例#19
0
 /**
  * @param Reader $reader
  * @param \Magento\Framework\Config\CacheInterface $cache
  */
 public function __construct(Reader $reader, \Magento\Framework\Config\CacheInterface $cache)
 {
     $this->cacheTags = [\Magento\Eav\Model\Entity\Attribute::CACHE_TAG];
     parent::__construct($reader, $cache, 'data_source');
 }
示例#20
0
 /**
  * Get config value by key
  *
  * @param string $path
  * @param mixed $default
  * @return array|mixed|null
  */
 public function get($path = null, $default = null)
 {
     $this->_loadScopedData();
     return parent::get($path, $default);
 }
示例#21
0
 /**
  * @param \Magento\Catalog\Model\Attribute\Config\Reader $reader
  * @param \Magento\Framework\Config\CacheInterface $cache
  */
 public function __construct(\Magento\Catalog\Model\Attribute\Config\Reader $reader, \Magento\Framework\Config\CacheInterface $cache)
 {
     parent::__construct($reader, $cache, 'catalog_attributes');
 }
示例#22
0
 /**
  * Initialize dependencies.
  *
  * @param \Magento\Framework\Communication\Config\CompositeReader $reader
  * @param \Magento\Framework\Config\CacheInterface $cache
  * @param string $cacheId
  */
 public function __construct(\Magento\Framework\Communication\Config\CompositeReader $reader, \Magento\Framework\Config\CacheInterface $cache, $cacheId = 'communication_config_cache')
 {
     parent::__construct($reader, $cache, $cacheId);
 }
示例#23
0
 public function __construct(\Firebear\ImportExport\Model\Source\Config\Reader $reader, \Magento\Framework\Config\CacheInterface $cache, $cacheId = 'firebear_importexport_config')
 {
     parent::__construct($reader, $cache, $cacheId);
 }
示例#24
0
 /**
  * Init data for configuration.
  *
  * @return void
  */
 protected function initData()
 {
     parent::initData();
     $this->_data = array_map([$this, 'initIndexConfig'], $this->_data);
 }
示例#25
0
 /**
  * @param \Magento\Eav\Model\Entity\Attribute\Config\Reader $reader
  * @param \Magento\Framework\Config\CacheInterface $cache
  * @param string $cacheId
  * @codeCoverageIgnore
  */
 public function __construct(\Magento\Eav\Model\Entity\Attribute\Config\Reader $reader, \Magento\Framework\Config\CacheInterface $cache, $cacheId = "eav_attributes")
 {
     parent::__construct($reader, $cache, $cacheId);
 }
示例#26
0
 /**
  * Constructor
  *
  * @param \Magento\Framework\Search\SearchEngine\Config\Reader $reader
  * @param \Magento\Framework\Config\CacheInterface $cache
  * @param string $cacheId
  */
 public function __construct(\Magento\Framework\Search\SearchEngine\Config\Reader $reader, \Magento\Framework\Config\CacheInterface $cache, $cacheId = 'search_engine_config_cache')
 {
     parent::__construct($reader, $cache, $cacheId);
 }