Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
MergeDataProvider.php
Go to the documentation of this file.
1 <?php
7 
8 use Magento\UrlRewrite\Service\V1\Data\UrlRewrite as UrlRewriteService;
9 
18 {
19  const SEPARATOR = '_';
20 
24  private $data = [];
25 
33  public function merge(array $urlRewritesArray)
34  {
35  foreach ($urlRewritesArray as $urlRewrite) {
36  $key = $urlRewrite->getRequestPath() . self::SEPARATOR . $urlRewrite->getStoreId();
37  if ($key !== self::SEPARATOR) {
38  $this->data[$key] = $urlRewrite;
39  } else {
40  $this->data[] = $urlRewrite;
41  }
42  }
43  }
44 
51  public function getData()
52  {
53  return $this->data;
54  }
55 }