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-google-optimizer
Block
Adminhtml
Cms
Page
EntityCmsPage.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\GoogleOptimizer\Block\Adminhtml\Cms\Page
;
7
8
use
Magento\Framework\DataObject
;
9
use
Magento\Framework\Exception\NoSuchEntityException
;
10
use
Magento\GoogleOptimizer\Model\Code
as GoogleOptimizerCode;
11
12
class
EntityCmsPage
extends
DataObject
13
{
17
private
$coreRegistry;
18
22
private
$codeModel;
23
29
private
$entity;
30
36
public
function
__construct
(
37
\
Magento
\Framework\Registry
$registry
,
38
GoogleOptimizerCode
$code
,
39
array
$data
= []
40
) {
41
$this->coreRegistry =
$registry
;
42
$this->codeModel =
$code
;
43
parent::__construct(
$data
);
44
}
45
52
public
function
getCode
()
53
{
54
$code
=
null
;
55
$entity = $this->getEntity();
56
if
($entity->getId()) {
57
$this->codeModel->loadByEntityIdAndType($entity->getId(), GoogleOptimizerCode::ENTITY_TYPE_PAGE);
58
$code
= $this->codeModel;
59
}
60
return
$code
;
61
}
62
69
private
function
getEntity()
70
{
71
if
(!$this->entity) {
72
$this->entity = $this->coreRegistry->registry(
'cms_page'
);
73
if
(!$this->entity) {
74
throw
new
NoSuchEntityException
();
75
}
76
}
77
return
$this->entity;
78
}
79
}
Magento\GoogleOptimizer\Block\Adminhtml\Cms\Page
Magento\GoogleOptimizer\Block\Adminhtml\Cms\Page\EntityCmsPage\getCode
getCode()
Definition:
EntityCmsPage.php:52
Magento\GoogleOptimizer\Block\Adminhtml\Cms\Page\EntityCmsPage
Definition:
EntityCmsPage.php:12
Magento\GoogleOptimizer\Model\Code
Definition:
Code.php:22
Magento\Framework\DataObject
Definition:
DataObject.php:15
$registry
$registry
Definition:
bundle_product_with_not_visible_children_rollback.php:16
$data
$data
Definition:
attribute_set_with_image_attribute.php:16
Magento
Magento\GoogleOptimizer\Block\Adminhtml\Cms\Page\EntityCmsPage\__construct
__construct(\Magento\Framework\Registry $registry, GoogleOptimizerCode $code, array $data=[])
Definition:
EntityCmsPage.php:36
$code
$code
Definition:
info.phtml:12
Magento\Framework\Exception\NoSuchEntityException
Definition:
NoSuchEntityException.php:16
Magento\Framework\DataObject
Definition:
Cache.php:6