Smile\ElasticsuiteCore\Model\Search\Request\RelevanceConfig\Initial::getData PHP Method

getData() public method

Get initial data by given scope
public getData ( string $scope ) : array
$scope string Format is scope type and scope code separated by pipe: e.g. "type|code"
return array
    public function getData($scope)
    {
        return isset($this->data[$scope]) ? $this->data[$scope] : [];
    }

Usage Example

Example #1
0
 /**
  * Read configuration by code
  *
  * @param null|string $code The container code
  *
  * @return array
  */
 public function read($code = null)
 {
     $config = array_replace_recursive($this->defaultReader->read(ContainerScopeInterface::SCOPE_DEFAULT), $this->initialConfig->getData($code));
     $collection = $this->collectionFactory->create(['scope' => ContainerScopeInterface::SCOPE_CONTAINERS, 'scopeCode' => $code]);
     $dbContainerConfig = [];
     foreach ($collection as $item) {
         $dbContainerConfig[$item->getPath()] = $item->getValue();
     }
     $dbContainerConfig = $this->converter->convert($dbContainerConfig);
     if (count($dbContainerConfig)) {
         $config = array_replace_recursive($config, $dbContainerConfig);
     }
     return $config;
 }
All Usage Examples Of Smile\ElasticsuiteCore\Model\Search\Request\RelevanceConfig\Initial::getData