Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Product.php
Go to the documentation of this file.
1 <?php
7 
10 
11 class Product
12 {
16  private $type;
17 
21  public function __construct(Type $type)
22  {
23  $this->type = $type;
24  }
25 
31  public function afterGetIdentities(
33  array $identities
34  ) {
35  foreach ($this->type->getParentIdsByChild($product->getEntityId()) as $parentId) {
36  $identities[] = CatalogProduct::CACHE_TAG . '_' . $parentId;
37  }
38  return $identities;
39  }
40 }
$type
Definition: item.phtml:13
afterGetIdentities(CatalogProduct $product, array $identities)
Definition: Product.php:31