Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Data.php
Go to the documentation of this file.
1 <?php
7 
15 
24 class Data extends AbstractBlock implements IdentityInterface
25 {
29  private $robots;
30 
34  private $storeManager;
35 
45  public function __construct(
46  Context $context,
47  Robots $robots,
48  StoreResolver $storeResolver,
49  StoreManagerInterface $storeManager = null,
50  array $data = []
51  ) {
52  $this->robots = $robots;
53  $this->storeManager = $storeManager ?: \Magento\Framework\App\ObjectManager::getInstance()
54  ->get(StoreManagerInterface::class);
55 
56  parent::__construct($context, $data);
57  }
58 
65  protected function _toHtml()
66  {
67  return $this->robots->getData() . PHP_EOL;
68  }
69 
76  public function getIdentities()
77  {
78  return [
79  Value::CACHE_TAG . '_' . $this->storeManager->getStore()->getId(),
80  ];
81  }
82 }
__construct(Context $context, Robots $robots, StoreResolver $storeResolver, StoreManagerInterface $storeManager=null, array $data=[])
Definition: Data.php:45