Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Value.php
Go to the documentation of this file.
1 <?php
7 
10 use Magento\Framework\App\Config\Value as ConfigValue;
18 
27 class Value extends ConfigValue implements IdentityInterface
28 {
32  const CACHE_TAG = 'robots';
33 
40  protected $_cacheTag = true;
41 
45  private $storeManager;
46 
60  public function __construct(
61  Context $context,
65  StoreResolver $storeResolver,
66  StoreManagerInterface $storeManager = null,
68  AbstractDb $resourceCollection = null,
69  array $data = []
70  ) {
71  $this->storeManager = $storeManager ?: \Magento\Framework\App\ObjectManager::getInstance()
72  ->get(StoreManagerInterface::class);
73 
74  parent::__construct(
75  $context,
76  $registry,
77  $config,
79  $resource,
80  $resourceCollection,
81  $data
82  );
83  }
84 
91  public function getIdentities()
92  {
93  return [
94  self::CACHE_TAG . '_' . $this->storeManager->getStore()->getId(),
95  ];
96  }
97 }
$config
Definition: fraud_order.php:17
$resource
Definition: bulk.php:12
__construct(Context $context, Registry $registry, ScopeConfigInterface $config, TypeListInterface $cacheTypeList, StoreResolver $storeResolver, StoreManagerInterface $storeManager=null, AbstractResource $resource=null, AbstractDb $resourceCollection=null, array $data=[])
Definition: Value.php:60