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-catalog
Setup
Patch
Data
UpdateProductMetaDescription.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Catalog\Setup\Patch\Data
;
8
9
use
Magento\Eav\Setup\EavSetup
;
10
use Magento\Eav\Setup\EavSetupFactory;
11
use
Magento\Framework\App\ResourceConnection
;
12
use
Magento\Framework\Setup\ModuleDataSetupInterface
;
13
use
Magento\Framework\Setup\Patch\DataPatchInterface
;
14
use
Magento\Framework\Setup\Patch\PatchVersionInterface
;
15
21
class
UpdateProductMetaDescription
implements
DataPatchInterface
,
PatchVersionInterface
22
{
26
private
$moduleDataSetup;
27
31
private
$eavSetupFactory;
32
38
public
function
__construct
(
39
ModuleDataSetupInterface
$moduleDataSetup,
40
EavSetupFactory $eavSetupFactory
41
) {
42
$this->moduleDataSetup = $moduleDataSetup;
43
$this->eavSetupFactory =
$eavSetupFactory
;
44
}
45
49
public
function
apply
()
50
{
52
$eavSetup
= $this->eavSetupFactory->create([
'setup'
=> $this->moduleDataSetup]);
53
54
$eavSetup
->updateAttribute(
55
\
Magento
\Catalog\Model\
Product::ENTITY
,
56
'meta_description'
,
57
[
58
'note'
=>
'Maximum 255 chars. Meta Description should optimally be between 150-160 characters'
59
]
60
);
61
}
62
66
public
static
function
getDependencies
()
67
{
68
return
[
69
UpdateProductAttributes::class,
70
];
71
}
72
76
public
static
function
getVersion
()
77
{
78
return
'2.0.7'
;
79
}
80
84
public
function
getAliases
()
85
{
86
return
[];
87
}
88
}
Magento\Catalog\Setup\Patch\Data\UpdateProductMetaDescription\getVersion
static getVersion()
Definition:
UpdateProductMetaDescription.php:76
Magento\Catalog\Model\Product\ENTITY
const ENTITY
Definition:
Product.php:57
Magento\Catalog\Setup\Patch\Data\UpdateProductMetaDescription
Definition:
UpdateProductMetaDescription.php:21
Magento\Framework\Setup\Patch\DataPatchInterface
Definition:
DataPatchInterface.php:12
Magento\Catalog\Setup\Patch\Data\UpdateProductMetaDescription\getAliases
getAliases()
Definition:
UpdateProductMetaDescription.php:84
Magento\Framework\Setup\ModuleDataSetupInterface
Definition:
ModuleDataSetupInterface.php:14
Magento\Framework\Setup\Patch\PatchInterface\apply
apply()
Magento
Magento\Eav\Setup\EavSetup
Definition:
EavSetup.php:25
Magento\Catalog\Setup\Patch\Data\UpdateProductMetaDescription\__construct
__construct(ModuleDataSetupInterface $moduleDataSetup, EavSetupFactory $eavSetupFactory)
Definition:
UpdateProductMetaDescription.php:38
Magento\Framework\Setup\Patch\PatchVersionInterface
Definition:
PatchVersionInterface.php:13
Magento\Catalog\Setup\Patch\Data
Definition:
ChangePriceAttributeDefaultScope.php:7
Magento\Framework\App\ResourceConnection
$eavSetupFactory
$eavSetupFactory
Definition:
product_for_search_rollback.php:21
Magento\Catalog\Setup\Patch\Data\UpdateProductMetaDescription\getDependencies
static getDependencies()
Definition:
UpdateProductMetaDescription.php:66
$eavSetup
$eavSetup
Definition:
product_for_search_rollback.php:23