123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- <?php
- /**
- * Customer group collection
- *
- * Copyright © Magento, Inc. All rights reserved.
- * See COPYING.txt for license details.
- */
- namespace Magento\Customer\Model\ResourceModel\Group\Grid;
- use Magento\Customer\Model\ResourceModel\Group\Collection as GroupCollection;
- use Magento\Framework\Api\Search\SearchResultInterface;
- use Magento\Framework\Search\AggregationInterface;
- /**
- * Collection for displaying grid of customer groups
- */
- class Collection extends GroupCollection implements SearchResultInterface
- {
- /**
- * @var AggregationInterface
- */
- protected $aggregations;
- /**
- * @param \Magento\Framework\Data\Collection\EntityFactoryInterface $entityFactory
- * @param \Psr\Log\LoggerInterface $logger
- * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy
- * @param \Magento\Framework\Event\ManagerInterface $eventManager
- * @param string $mainTable
- * @param string $eventPrefix
- * @param string $eventObject
- * @param string $resourceModel
- * @param string $model
- * @param \Magento\Framework\DB\Adapter\AdapterInterface|string|null $connection
- * @param \Magento\Framework\Model\ResourceModel\Db\AbstractDb $resource
- *
- * @SuppressWarnings(PHPMD.ExcessiveParameterList)
- */
- public function __construct(
- \Magento\Framework\Data\Collection\EntityFactoryInterface $entityFactory,
- \Psr\Log\LoggerInterface $logger,
- \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy,
- \Magento\Framework\Event\ManagerInterface $eventManager,
- $mainTable,
- $eventPrefix,
- $eventObject,
- $resourceModel,
- $model = \Magento\Framework\View\Element\UiComponent\DataProvider\Document::class,
- $connection = null,
- \Magento\Framework\Model\ResourceModel\Db\AbstractDb $resource = null
- ) {
- parent::__construct(
- $entityFactory,
- $logger,
- $fetchStrategy,
- $eventManager,
- $connection,
- $resource
- );
- $this->_eventPrefix = $eventPrefix;
- $this->_eventObject = $eventObject;
- $this->_init($model, $resourceModel);
- $this->setMainTable($mainTable);
- }
- /**
- * Resource initialization
- * @return $this
- */
- protected function _initSelect()
- {
- parent::_initSelect();
- $this->addTaxClass();
- return $this;
- }
- /**
- * @return AggregationInterface
- */
- public function getAggregations()
- {
- return $this->aggregations;
- }
- /**
- * @param AggregationInterface $aggregations
- * @return $this
- */
- public function setAggregations($aggregations)
- {
- $this->aggregations = $aggregations;
- return $this;
- }
- /**
- * Get search criteria.
- *
- * @return \Magento\Framework\Api\SearchCriteriaInterface|null
- */
- public function getSearchCriteria()
- {
- return null;
- }
- /**
- * Set search criteria.
- *
- * @param \Magento\Framework\Api\SearchCriteriaInterface $searchCriteria
- * @return $this
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
- */
- public function setSearchCriteria(\Magento\Framework\Api\SearchCriteriaInterface $searchCriteria = null)
- {
- return $this;
- }
- /**
- * Get total count.
- *
- * @return int
- */
- public function getTotalCount()
- {
- return $this->getSize();
- }
- /**
- * Set total count.
- *
- * @param int $totalCount
- * @return $this
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
- */
- public function setTotalCount($totalCount)
- {
- return $this;
- }
- /**
- * Set items list.
- *
- * @param \Magento\Framework\Api\ExtensibleDataInterface[] $items
- * @return $this
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
- */
- public function setItems(array $items = null)
- {
- return $this;
- }
- }
|