Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
DeleteEntityRow.php
Go to the documentation of this file.
1 <?php
7 
9 
11 {
15  protected $metadataPool;
16 
20  public function __construct(
22  ) {
23  $this->metadataPool = $metadataPool;
24  }
25 
32  public function execute($entityType, $data)
33  {
34  $metadata = $this->metadataPool->getMetadata($entityType);
35  $connection = $metadata->getEntityConnection();
36  return $connection->delete(
37  $metadata->getEntityTable(),
38  [$metadata->getLinkField() . ' = ?' => $data[$metadata->getLinkField()]]
39  );
40  }
41 }
$connection
Definition: bulk.php:13