Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ModifierPoolDataProvider.php
Go to the documentation of this file.
1 <?php
7 
12 
14 {
18  private $pool;
19 
28  public function __construct(
29  $name,
32  array $meta = [],
33  array $data = [],
34  PoolInterface $pool = null
35  ) {
36  parent::__construct($name, $primaryFieldName, $requestFieldName, $meta, $data);
37  $this->pool = $pool ?: ObjectManager::getInstance()->get(PoolInterface::class);
38  }
39 
43  public function getData()
44  {
45  $this->getConfigData();
46 
47  foreach ($this->pool->getModifiersInstances() as $modifier) {
48  $this->data = $modifier->modifyData($this->data);
49  }
50 
51  return $this->data;
52  }
53 
57  public function getMeta()
58  {
59  $this->meta = parent::getMeta();
60 
62  $this->pool->getModifiers();
63 
64  foreach ($this->pool->getModifiersInstances() as $modifier) {
65  $this->meta = $modifier->modifyMeta($this->meta);
66  }
67 
68  return $this->meta;
69  }
70 }
__construct( $name, $primaryFieldName, $requestFieldName, array $meta=[], array $data=[], PoolInterface $pool=null)