Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Autocomplete.php
Go to the documentation of this file.
1 <?php
6 namespace Magento\Search\Model;
7 
9 {
13  private $dataProviders;
14 
18  public function __construct(
19  array $dataProviders
20  ) {
21  $this->dataProviders = $dataProviders;
22  ksort($this->dataProviders);
23  }
24 
28  public function getItems()
29  {
30  $data = [];
31  foreach ($this->dataProviders as $dataProvider) {
32  $data = array_merge($data, $dataProvider->getItems());
33  }
34 
35  return $data;
36  }
37 }
__construct(array $dataProviders)