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-asynchronous-operations
Model
Entity
BulkSummaryMapper.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\AsynchronousOperations\Model\Entity
;
7
8
use
Magento\Framework\EntityManager\MapperInterface
;
9
use
Magento\Framework\App\ResourceConnection
;
10
use
Magento\Framework\EntityManager\MetadataPool
;
11
15
class
BulkSummaryMapper
implements
MapperInterface
16
{
20
private
$metadataPool;
21
25
private
$resourceConnection;
26
31
public
function
__construct
(
32
MetadataPool
$metadataPool,
33
ResourceConnection
$resourceConnection
34
) {
35
$this->metadataPool = $metadataPool;
36
$this->resourceConnection =
$resourceConnection
;
37
}
38
42
public
function
entityToDatabase
(
$entityType
,
$data
)
43
{
44
// workaround for delete/update operations that are currently using only primary key as identifier
45
if
(!empty(
$data
[
'uuid'
])) {
46
$metadata = $this->metadataPool->getMetadata(
$entityType
);
47
$connection
= $this->resourceConnection->getConnectionByName($metadata->getEntityConnectionName());
48
$select
=
$connection
->select()->from($metadata->getEntityTable(),
'id'
)->where(
"uuid = ?"
,
$data
[
'uuid'
]);
49
$identifier =
$connection
->fetchOne(
$select
);
50
if
($identifier !==
false
) {
51
$data
[
'id'
] = $identifier;
52
}
53
}
54
return
$data
;
55
}
56
61
public
function
databaseToEntity
(
$entityType
,
$data
)
62
{
63
return
$data
;
64
}
65
}
Magento\AsynchronousOperations\Model\Entity\BulkSummaryMapper\__construct
__construct(MetadataPool $metadataPool, ResourceConnection $resourceConnection)
Definition:
BulkSummaryMapper.php:31
Magento\AsynchronousOperations\Model\Entity\BulkSummaryMapper
Definition:
BulkSummaryMapper.php:15
Magento\AsynchronousOperations\Model\Entity\BulkSummaryMapper\entityToDatabase
entityToDatabase($entityType, $data)
Definition:
BulkSummaryMapper.php:42
$entityType
$entityType
Definition:
attribute_set_with_image_attribute.php:13
$select
$select
Definition:
catalog_rule_10_off_not_logged_rollback.php:14
Magento\Framework\EntityManager\MetadataPool
Definition:
MetadataPool.php:18
$data
$data
Definition:
attribute_set_with_image_attribute.php:16
Magento\Framework\EntityManager\MapperInterface
Definition:
MapperInterface.php:11
Magento\AsynchronousOperations\Model\Entity
Definition:
BulkSummaryMapper.php:6
Magento\AsynchronousOperations\Model\Entity\BulkSummaryMapper\databaseToEntity
databaseToEntity($entityType, $data)
Definition:
BulkSummaryMapper.php:61
$resourceConnection
$resourceConnection
Definition:
website_attribute_sync.php:32
Magento\Framework\App\ResourceConnection
Definition:
ResourceConnection.php:18
$connection
$connection
Definition:
bulk.php:13
Magento\Framework\App\ResourceConnection