123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214 |
- <?php
- /**
- * Copyright © Magento, Inc. All rights reserved.
- * See COPYING.txt for license details.
- */
- namespace Magento\ReleaseNotification\Ui\DataProvider;
- use Magento\Framework\Api\Search\SearchCriteriaInterface;
- use Magento\Framework\Api\Search\SearchResultInterface;
- use Magento\Framework\View\Element\UiComponent\DataProvider\DataProviderInterface;
- use Magento\Ui\DataProvider\Modifier\ModifierInterface;
- use Magento\Ui\DataProvider\Modifier\PoolInterface;
- /**
- * Data Provider for the Release Notifications UI component.
- */
- class NotificationDataProvider implements DataProviderInterface
- {
- /**
- * @var PoolInterface
- */
- private $pool;
- /**
- * Search result object.
- *
- * @var SearchResultInterface
- */
- private $searchResult;
- /**
- * Search criteria object.
- *
- * @var SearchCriteriaInterface
- */
- private $searchCriteria;
- /**
- * Own name of this provider.
- *
- * @var string
- */
- private $name;
- /**
- * Provider configuration data.
- *
- * @var array
- */
- private $data;
- /**
- * Provider configuration meta.
- *
- * @var array
- */
- private $meta;
- /**
- * @param string $name
- * @param SearchResultInterface $searchResult
- * @param SearchCriteriaInterface $searchCriteria
- * @param PoolInterface $pool
- * @param array $meta
- * @param array $data
- */
- public function __construct(
- $name,
- SearchResultInterface $searchResult,
- SearchCriteriaInterface $searchCriteria,
- PoolInterface $pool,
- array $meta = [],
- array $data = []
- ) {
- $this->name = $name;
- $this->searchResult = $searchResult;
- $this->searchCriteria = $searchCriteria;
- $this->pool = $pool;
- $this->meta = $meta;
- $this->data = $data;
- }
- /**
- * @inheritdoc
- */
- public function getData()
- {
- /** @var ModifierInterface $modifier */
- foreach ($this->pool->getModifiersInstances() as $modifier) {
- $this->data = $modifier->modifyData($this->data);
- }
- return $this->data;
- }
- /**
- * @inheritdoc
- */
- public function getMeta()
- {
- /** @var ModifierInterface $modifier */
- foreach ($this->pool->getModifiersInstances() as $modifier) {
- $this->meta = $modifier->modifyMeta($this->meta);
- }
- return $this->meta;
- }
- /**
- * @inheritdoc
- */
- public function getName()
- {
- return $this->name;
- }
- /**
- * @inheritdoc
- */
- public function getConfigData()
- {
- return $this->data['config'] ?? [];
- }
- /**
- * @inheritdoc
- */
- public function setConfigData($config)
- {
- $this->data['config'] = $config;
- return true;
- }
- /**
- * @inheritdoc
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
- */
- public function getFieldMetaInfo($fieldSetName, $fieldName)
- {
- return [];
- }
- /**
- * @inheritdoc
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
- */
- public function getFieldSetMetaInfo($fieldSetName)
- {
- return [];
- }
- /**
- * @inheritdoc
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
- */
- public function getFieldsMetaInfo($fieldSetName)
- {
- return [];
- }
- /**
- * @inheritdoc
- */
- public function getPrimaryFieldName()
- {
- return 'release_notification';
- }
- /**
- * @inheritdoc
- */
- public function getRequestFieldName()
- {
- return 'release_notification';
- }
- /**
- * @inheritdoc
- */
- public function addFilter(\Magento\Framework\Api\Filter $filter)
- {
- }
- /**
- * @inheritdoc
- */
- public function addOrder($field, $direction)
- {
- }
- /**
- * @inheritdoc
- */
- public function setLimit($offset, $size)
- {
- }
- /**
- * @inheritdoc
- */
- public function getSearchCriteria()
- {
- return $this->searchCriteria;
- }
- /**
- * @inheritdoc
- */
- public function getSearchResult()
- {
- return $this->searchResult;
- }
- }
|