Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ReadHandler.php
Go to the documentation of this file.
1 <?php
7 
11 
16 {
20  protected $ruleResource;
21 
25  protected $metadataPool;
26 
31  public function __construct(
34  ) {
35  $this->ruleResource = $ruleResource;
36  $this->metadataPool = $metadataPool;
37  }
38 
46  public function execute($entityType, $entityData, $arguments = [])
47  {
48  $linkField = $this->metadataPool->getMetadata($entityType)->getLinkField();
49  $entityId = $entityData[$linkField];
50 
51  $entityData['customer_group_ids'] = $this->ruleResource->getCustomerGroupIds($entityId);
52  $entityData['website_ids'] = $this->ruleResource->getWebsiteIds($entityId);
53 
54  return $entityData;
55  }
56 }
execute($entityType, $entityData, $arguments=[])
Definition: ReadHandler.php:46
$arguments
__construct(Rule $ruleResource, MetadataPool $metadataPool)
Definition: ReadHandler.php:31