コード例 #1
0
 /**
  * {@inheritdoc}
  */
 public function getData()
 {
     $data = parent::getData();
     foreach ($this->attributeRepository->getList() as $attributeCode => $attributeData) {
         foreach ($data['items'] as &$item) {
             if (isset($item[$attributeCode]) && !empty($attributeData[AttributeMetadataInterface::OPTIONS])) {
                 $item[$attributeCode] = explode(',', $item[$attributeCode]);
             }
         }
     }
     return $data;
 }
コード例 #2
0
 /**
  * @inheritdoc
  *
  * @SuppressWarnings(PHPMD.ExcessiveParameterList)
  */
 public function __construct(\Magento\Framework\UrlInterface $url, \Praxigento\Core\Repo\Query\Criteria\IAdapter $critAdapter, \Praxigento\Core\Repo\Query\Criteria\IMapper $api2sqlMapper = null, \Praxigento\Core\Repo\ICrud $repo, \Magento\Framework\View\Element\UiComponent\DataProvider\Reporting $reporting, \Magento\Framework\Api\Search\SearchCriteriaBuilder $searchCritBuilder, \Magento\Framework\App\RequestInterface $request, \Magento\Framework\Api\FilterBuilder $filterBuilder, $name, array $meta = [], array $data = [])
 {
     /* add default Update URL */
     if (!isset($data[static::UIC_CONFIG][static::UIC_UPDATE_URL])) {
         $val = $url->getRouteUrl(static::UICD_UPDATE_URL);
         $data[static::UIC_CONFIG][static::UIC_UPDATE_URL] = $val;
     }
     parent::__construct($name, 'entity_id', 'id', $reporting, $searchCritBuilder, $request, $filterBuilder, $meta, $data);
     /* post construction setup */
     $this->_criteriaAdapter = $critAdapter;
     $this->_api2sqlMapper = $api2sqlMapper;
     $this->_repo = $repo;
 }
コード例 #3
0
 /**
  * Get data
  *
  * @return array
  */
 public function getData()
 {
     if ($this->storeManager->isSingleStoreMode()) {
         $websites = $this->storeManager->getWebsites();
         $singleStoreWebsite = array_shift($websites);
         $this->addFilter($this->filterBuilder->setField('store_website_id')->setValue($singleStoreWebsite->getId())->create());
         $this->addFilter($this->filterBuilder->setField('store_group_id')->setConditionType('null')->create());
     }
     $data = parent::getData();
     foreach ($data['items'] as &$item) {
         $item += ['default' => __('Global')];
     }
     return $data;
 }
コード例 #4
0
 /**
  * @param string $name
  * @param string $primaryFieldName
  * @param string $requestFieldName
  * @param Reporting $reporting
  * @param SearchCriteriaBuilder $searchCriteriaBuilder
  * @param RequestInterface $request
  * @param FilterBuilder $filterBuilder
  * @param array $meta
  * @param array $data
  */
 public function __construct($name, $primaryFieldName, $requestFieldName, Reporting $reporting, SearchCriteriaBuilder $searchCriteriaBuilder, RequestInterface $request, FilterBuilder $filterBuilder, array $meta = [], array $data = [])
 {
     parent::__construct($name, $primaryFieldName, $requestFieldName, $reporting, $searchCriteriaBuilder, $request, $filterBuilder, $meta, $data);
 }
コード例 #5
0
ファイル: DataProvider.php プロジェクト: mirasvit/module-blog
 /**
  * @param string                $name
  * @param string                $primaryFieldName
  * @param string                $requestFieldName
  * @param Reporting             $reporting
  * @param SearchCriteriaBuilder $searchCriteriaBuilder
  * @param RequestInterface      $request
  * @param FilterBuilder         $filterBuilder
  * @param AttributeRepository   $attributeRepository
  * @param array                 $meta
  * @param array                 $data
  * @SuppressWarnings(PHPMD.ExcessiveParameterList)
  */
 public function __construct($name, $primaryFieldName, $requestFieldName, Reporting $reporting, SearchCriteriaBuilder $searchCriteriaBuilder, RequestInterface $request, FilterBuilder $filterBuilder, AttributeRepository $attributeRepository, array $meta = [], array $data = [])
 {
     $this->attributeRepository = $attributeRepository;
     parent::__construct($name, $primaryFieldName, $requestFieldName, $reporting, $searchCriteriaBuilder, $request, $filterBuilder, $meta, $data);
 }