Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ImageTypeProcessor.php
Go to the documentation of this file.
1 <?php
7 
9 
11 {
15  private $resourceFactory;
16 
20  public function __construct(
21  \Magento\CatalogImportExport\Model\Import\Proxy\Product\ResourceModelFactory $resourceFactory
22  ) {
23  $this->resourceFactory = $resourceFactory;
24  }
25 
29  public function getImageTypes()
30  {
31  $imageKeys = [];
33  $resource = $this->resourceFactory->create();
34  $connection = $resource->getConnection();
35  $select = $connection->select();
36  $select->from(
37  $resource->getTable('eav_attribute'),
38  ['code' => 'attribute_code']
39  );
40  $select->where(
41  'frontend_input = :frontend_input'
42  );
43  $bind = [':frontend_input' => 'media_image'];
44 
45  $imageKeys = $connection->fetchCol($select, $bind);
46  $imageKeys[] = '_media_image';
47 
48  return $imageKeys;
49  }
50 }
$resource
Definition: bulk.php:12
__construct(\Magento\CatalogImportExport\Model\Import\Proxy\Product\ResourceModelFactory $resourceFactory)
$connection
Definition: bulk.php:13