![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/mageworx/module-xmlsitemap/Model/ResourceModel/Sitemap/Grid/ |
<?php /** * Copyright © MageWorx. All rights reserved. * See LICENSE.txt for license details. */ namespace MageWorx\XmlSitemap\Model\ResourceModel\Sitemap\Grid; use Magento\Framework\Api\ExtensibleDataInterface; use Magento\Framework\DB\Adapter\AdapterInterface; use Magento\Framework\DB\Select; use Magento\Framework\Search\AggregationInterface; use MageWorx\XmlSitemap\Model\ResourceModel\Sitemap\Collection as SitemapCollection; use Magento\Framework\Api\Search\SearchResultInterface; use Magento\Framework\Api\SearchCriteriaInterface; use Magento\Framework\Data\Collection\EntityFactoryInterface; use Psr\Log\LoggerInterface; use Magento\Framework\Data\Collection\Db\FetchStrategyInterface; use Magento\Framework\Event\ManagerInterface; use Magento\Framework\Model\ResourceModel\Db\AbstractDb; class Collection extends SitemapCollection implements SearchResultInterface { /** * Aggregations * * @var AggregationInterface */ protected $aggregations; /** * constructor * * @param EntityFactoryInterface $entityFactory * @param LoggerInterface $logger * @param FetchStrategyInterface $fetchStrategy * @param ManagerInterface $eventManager * @param string $mainTable * @param string $eventPrefix * @param string $eventObject * @param string $resourceModel * @param string $model * @param AdapterInterface $connection * @param AbstractDb $resource */ public function __construct( EntityFactoryInterface $entityFactory, LoggerInterface $logger, FetchStrategyInterface $fetchStrategy, ManagerInterface $eventManager, $mainTable, $eventPrefix, $eventObject, $resourceModel, $model = 'Magento\Framework\View\Element\UiComponent\DataProvider\Document', AdapterInterface $connection = null, AbstractDb $resource = null ) { parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource); $this->_eventPrefix = $eventPrefix; $this->_eventObject = $eventObject; $this->_init($model, $resourceModel); $this->setMainTable($mainTable); } /** * @return AggregationInterface */ public function getAggregations() { return $this->aggregations; } /** * @param AggregationInterface $aggregations * @return $this */ public function setAggregations($aggregations) { $this->aggregations = $aggregations; } /** * Retrieve all ids for collection * Backward compatibility with EAV collection * * @param int $limit * @param int $offset * @return array */ public function getAllIds($limit = null, $offset = null) { return $this->getConnection()->fetchCol($this->_getAllIdsSelect($limit, $offset), $this->_bindParams); } /** * Get search criteria. * * @return SearchCriteriaInterface|null */ public function getSearchCriteria() { return null; } /** * Set search criteria. * * @param SearchCriteriaInterface $searchCriteria * @return $this * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function setSearchCriteria(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 ExtensibleDataInterface[] $items * @return $this * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function setItems(array $items = null) { return $this; } /** * @return $this */ public function getItems() { return $this; } /** * Clone and reset collection * * @param null $limit * @param null $offset * @return Select */ protected function _getAllIdsSelect($limit = null, $offset = null) { $idsSelect = clone $this->getSelect(); $idsSelect->reset(Select::ORDER) ->reset(Select::LIMIT_COUNT) ->reset(Select::LIMIT_OFFSET) ->reset(Select::COLUMNS) ->columns('sitemap_id') ->limit($limit, $offset); return $idsSelect; } }