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
framework
EntityManager
Operation
Create
CreateMain.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Framework\EntityManager\Operation\Create
;
7
8
use
Magento\Framework\EntityManager\TypeResolver
;
9
use
Magento\Framework\EntityManager\HydratorPool
;
10
use
Magento\Framework\EntityManager\Db\CreateRow
;
11
15
class
CreateMain
16
{
20
private
$typeResolver;
21
25
private
$hydratorPool;
26
30
private
$createRow;
31
37
public
function
__construct
(
38
TypeResolver
$typeResolver,
39
HydratorPool
$hydratorPool,
40
CreateRow
$createRow
41
) {
42
$this->typeResolver = $typeResolver;
43
$this->hydratorPool = $hydratorPool;
44
$this->createRow = $createRow;
45
}
46
52
public
function
execute
(
$entity
,
$arguments
= [])
53
{
54
$entityType
= $this->typeResolver->resolve(
$entity
);
55
$hydrator = $this->hydratorPool->getHydrator(
$entityType
);
56
$arguments
= array_merge($hydrator->extract(
$entity
),
$arguments
);
57
$entityData = $this->createRow->execute(
$entityType
,
$arguments
);
58
$entity
= $hydrator->hydrate(
$entity
, $entityData);
59
return
$entity
;
60
}
61
}
Magento\Framework\EntityManager\Operation\Create
Definition:
CreateAttributes.php:6
Magento\Framework\EntityManager\Db\CreateRow
Definition:
CreateRow.php:17
Magento\Framework\EntityManager\Operation\Create\CreateMain\__construct
__construct(TypeResolver $typeResolver, HydratorPool $hydratorPool, CreateRow $createRow)
Definition:
CreateMain.php:37
$entityType
$entityType
Definition:
attribute_set_with_image_attribute.php:13
Magento\Framework\EntityManager\Operation\Create\CreateMain\execute
execute($entity, $arguments=[])
Definition:
CreateMain.php:52
Magento\Framework\EntityManager\HydratorPool
Definition:
HydratorPool.php:13
Magento\Framework\EntityManager\TypeResolver
Definition:
TypeResolver.php:11
$entity
$entity
Definition:
element.phtml:22
$arguments
$arguments
Definition:
final_price.phtml:24
Magento\Framework\EntityManager\Operation\Create\CreateMain
Definition:
CreateMain.php:15