Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AbstractHandler.php
Go to the documentation of this file.
1 <?php
7 
11 abstract class AbstractHandler
12 {
17  'value_id' => 'value_id',
18  'store_id' => 'store_id',
19  'video_provider' => 'provider',
20  'video_url' => 'url',
21  'video_title' => 'title',
22  'video_description' => 'description',
23  'video_metadata' => 'metadata'
24  ];
25 
29  protected $resourceModel;
30 
34  public function __construct(
35  \Magento\Catalog\Model\ResourceModel\Product\Gallery $resourceModel
36  ) {
37  $this->resourceModel = $resourceModel;
38  }
39 
45  protected function getMediaEntriesDataCollection(
46  \Magento\Catalog\Model\Product $product,
47  \Magento\Eav\Model\Entity\Attribute\AbstractAttribute $attribute
48  ) {
49  $attributeCode = $attribute->getAttributeCode();
50  $mediaData = $product->getData($attributeCode);
51  if (!empty($mediaData['images']) && is_array($mediaData['images'])) {
52  return $mediaData['images'];
53  }
54  return [];
55  }
56 }
$attributeCode
Definition: extend.phtml:12