Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
DimensionModes.php
Go to the documentation of this file.
1 <?php
6 declare(strict_types=1);
7 
8 namespace Magento\Indexer\Model;
9 
14 {
18  private $dimensions;
19 
23  public function __construct(array $dimensions)
24  {
25  $this->dimensions = (function (DimensionMode ...$dimensions) {
26  $result = [];
27  foreach ($dimensions as $dimension) {
28  $result[$dimension->getName()] = $dimension;
29  };
30  return $result;
31  })(...$dimensions);
32  }
33 
39  public function getDimensions(): array
40  {
41  return $this->dimensions;
42  }
43 }