Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
CompositeReader.php
Go to the documentation of this file.
1 <?php
7 
9 
14 {
20  private $validator;
21 
27  private $readers;
28 
35  public function __construct(ValidatorInterface $validator, array $readers)
36  {
37  $this->validator = $validator;
38  $this->readers = $readers;
39  }
40 
47  public function read($scope = null)
48  {
49  $result = [];
50  foreach ($this->readers as $reader) {
51  $result = array_replace_recursive($result, $reader->read($scope));
52  }
53  $this->validator->validate($result);
54  return $result;
55  }
56 }
__construct(ValidatorInterface $validator, array $readers)