Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-robots
Block
Data.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Robots\Block
;
7
8
use
Magento\Framework\DataObject\IdentityInterface
;
9
use
Magento\Framework\View\Element\AbstractBlock
;
10
use
Magento\Framework\View\Element\Context
;
11
use
Magento\Robots\Model\Config\Value
;
12
use
Magento\Robots\Model\Robots
;
13
use
Magento\Store\Model\StoreResolver
;
14
use
Magento\Store\Model\StoreManagerInterface
;
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
}
Magento\Robots\Block\Data\getIdentities
getIdentities()
Definition:
Data.php:76
Magento\Robots\Model\Robots
Definition:
Robots.php:14
Magento\Framework\App\ObjectManager\getInstance
static getInstance()
Definition:
ObjectManager.php:33
Magento\Store\Model\StoreResolver
Definition:
Group.php:6
Magento\Framework\DataObject\IdentityInterface
Definition:
IdentityInterface.php:13
Magento\Robots\Block\Data\_toHtml
_toHtml()
Definition:
Data.php:65
Magento\Framework\View\Element\AbstractBlock
Definition:
AbstractBlock.php:25
Magento\Store\Model\StoreManagerInterface
Definition:
StoreManagerInterface.php:17
$data
$data
Definition:
attribute_set_with_image_attribute.php:16
Magento\Robots\Block\Data\__construct
__construct(Context $context, Robots $robots, StoreResolver $storeResolver, StoreManagerInterface $storeManager=null, array $data=[])
Definition:
Data.php:45
Magento\Store\Model\StoreResolver
Definition:
StoreResolver.php:13
Magento\Robots\Model\Config\Value
Definition:
Value.php:27
Magento\Robots\Block
Definition:
Data.php:6
Magento\Robots\Model\Config\Value\CACHE_TAG
const CACHE_TAG
Definition:
Value.php:32
Magento\Framework\View\Element\Context
Definition:
Context.php:25
Magento\Robots\Block\Data
Definition:
Data.php:24