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
OperationPool.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Framework\EntityManager
;
8
9
use
Magento\Framework\ObjectManagerInterface
as ObjectManager;
10
use
Magento\Framework\EntityManager\Operation\CheckIfExists
;
11
use
Magento\Framework\EntityManager\Operation\Read
;
12
use
Magento\Framework\EntityManager\Operation\Create
;
13
use
Magento\Framework\EntityManager\Operation\Update
;
14
use
Magento\Framework\EntityManager\Operation\Delete
;
15
19
class
OperationPool
20
{
24
private
$defaultOperations = [
25
'checkIfExists'
=> CheckIfExists::class,
26
'read'
=> Read::class,
27
'create'
=> Create::class,
28
'update'
=> Update::class,
29
'delete'
=> Delete::class,
30
];
31
35
private
$operations;
36
40
private
$objectManager;
41
47
public
function
__construct
(
48
ObjectManager
$objectManager,
49
$operations = []
50
) {
51
$this->objectManager =
$objectManager
;
52
$this->operations = array_replace_recursive(
53
[
'default'
=> $this->defaultOperations],
54
$operations
55
);
56
}
57
65
public
function
getOperation
(
$entityType
, $operationName)
66
{
67
if
(!isset($this->operations[
$entityType
][$operationName])) {
68
return
$this->objectManager->get($this->operations[
'default'
][$operationName]);
69
}
70
return
$this->objectManager->get($this->operations[
$entityType
][$operationName]);
71
}
72
}
Magento\Framework\EntityManager\Operation\Create
Definition:
CreateAttributes.php:6
$objectManager
$objectManager
Definition:
bootstrap.php:17
Magento\Framework\ObjectManagerInterface
Definition:
ObjectManagerInterface.php:12
Magento\Framework\EntityManager\OperationPool
Definition:
OperationPool.php:19
Magento\Framework\EntityManager\Operation\Delete
Definition:
DeleteAttributes.php:6
$entityType
$entityType
Definition:
attribute_set_with_image_attribute.php:13
Magento\Framework\EntityManager
Definition:
AbstractModelHydrator.php:6
Magento\Framework\EntityManager\Operation\CheckIfExists
Definition:
CheckIfExists.php:17
Magento\Framework\EntityManager\OperationPool\getOperation
getOperation($entityType, $operationName)
Definition:
OperationPool.php:65
Magento\Framework\EntityManager\OperationPool\__construct
__construct(ObjectManager $objectManager, $operations=[])
Definition:
OperationPool.php:47
Magento\Framework\EntityManager\Operation\Read
Definition:
ReadAttributes.php:6
Magento\Framework\EntityManager\Operation\Update
Definition:
UpdateAttributes.php:6
Magento\Framework\App\ObjectManager
Definition:
ObjectManager.php:20