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-bundle
Model
Product
ReadHandler.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Bundle\Model\Product
;
7
8
use
Magento\Bundle\Api\ProductOptionRepositoryInterface
as OptionRepository;
9
use
Magento\Framework\EntityManager\Operation\ExtensionInterface
;
10
14
class
ReadHandler
implements
ExtensionInterface
15
{
19
private
$optionRepository;
20
26
public
function
__construct
(
OptionRepository
$optionRepository)
27
{
28
$this->optionRepository = $optionRepository;
29
}
30
37
public
function
execute
(
$entity
,
$arguments
= [])
38
{
40
if
(
$entity
->getTypeId() !=
\Magento\Bundle\Model\Product\Type::TYPE_CODE
) {
41
return
$entity
;
42
}
43
$entityExtension =
$entity
->getExtensionAttributes();
44
$options
= $this->optionRepository->getListByProduct(
$entity
);
45
if
(
$options
) {
46
$entityExtension->setBundleProductOptions(
$options
);
47
}
48
$entity
->setExtensionAttributes($entityExtension);
49
return
$entity
;
50
}
51
}
Magento\Bundle\Model\OptionRepository
Definition:
OptionRepository.php:20
Magento\Bundle\Model\Product\Type\TYPE_CODE
const TYPE_CODE
Definition:
Type.php:30
Magento\Framework\EntityManager\Operation\ExtensionInterface
Definition:
ExtensionInterface.php:11
Magento\Framework\EntityManager\Operation\ExtensionInterface\execute
execute($entity, $arguments=[])
Magento\Bundle\Model\Product\ReadHandler\__construct
__construct(OptionRepository $optionRepository)
Definition:
ReadHandler.php:26
$entity
$entity
Definition:
element.phtml:22
Magento\Bundle\Api\ProductOptionRepositoryInterface
Definition:
ProductOptionRepositoryInterface.php:14
$arguments
$arguments
Definition:
final_price.phtml:24
Magento\Bundle\Model\Product
Definition:
BundlePriceAbstract.php:7
Magento\Bundle\Model\Product\ReadHandler
Definition:
ReadHandler.php:14
$options
$options
Definition:
multiple_mixed_products.php:29