/** * @param string $name * @param string $primaryFieldName * @param string $requestFieldName * @param DataProvider\DataLoader $dataLoader * @param DataProvider\MetadataLoader $metadataLoader * @param CollectionFactory $configCollectionFactory * @param array $meta * @param array $data */ public function __construct($name, $primaryFieldName, $requestFieldName, DataProvider\DataLoader $dataLoader, DataProvider\MetadataLoader $metadataLoader, CollectionFactory $configCollectionFactory, array $meta = [], array $data = []) { parent::__construct($name, $primaryFieldName, $requestFieldName, $meta, $data); $this->dataLoader = $dataLoader; $this->metadataLoader = $metadataLoader; $this->collection = $configCollectionFactory->create(); $this->meta = array_merge($this->meta, $this->metadataLoader->getData()); }
/** * Get stored data for scope and scope id * * @param string $scope * @param string $scopeId * @return array */ protected function getScopeData($scope, $scopeId) { if (!isset($this->storedData[$scope][$scopeId])) { $collection = $this->collectionFactory->create(); $collection->addPathsFilter($this->getMetadata()); $collection->addFieldToFilter('scope', $scope); $collection->addScopeIdFilter($scopeId); $this->storedData[$scope][$scopeId] = $collection->getData(); } return $this->storedData[$scope][$scopeId]; }