Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Collection.php
Go to the documentation of this file.
1 <?php
7 
11 
17 {
18 
22  protected $aggregations;
23 
39  public function __construct(
40  \Magento\Framework\Data\Collection\EntityFactoryInterface $entityFactory,
41  \Psr\Log\LoggerInterface $logger,
42  \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy,
43  \Magento\Framework\Event\ManagerInterface $eventManager,
44  $mainTable,
45  $eventPrefix,
46  $eventObject,
48  $model = \Magento\Sales\Model\ResourceModel\Grid\Document::class,
49  $connection = null,
50  \Magento\Framework\Model\ResourceModel\Db\AbstractDb $resource = null
51  ) {
52  $this->_eventPrefix = $eventPrefix;
53  $this->_eventObject = $eventObject;
54  $this->_init($model, $resourceModel);
55  $this->setMainTable($mainTable);
56  parent::__construct(
57  $entityFactory,
58  $logger,
59  $fetchStrategy,
60  $eventManager,
62  $resource
63  );
64  }
65 
69  public function getAggregations()
70  {
71  return $this->aggregations;
72  }
73 
78  public function setAggregations($aggregations)
79  {
80  $this->aggregations = $aggregations;
81  return $this;
82  }
83 
92  public function getAllIds($limit = null, $offset = null)
93  {
94  return $this->getConnection()->fetchCol($this->_getAllIdsSelect($limit, $offset), $this->_bindParams);
95  }
96 
102  public function getSearchCriteria()
103  {
104  return null;
105  }
106 
114  public function setSearchCriteria(\Magento\Framework\Api\SearchCriteriaInterface $searchCriteria = null)
115  {
116  return $this;
117  }
118 
124  public function getTotalCount()
125  {
126  return $this->getSize();
127  }
128 
136  public function setTotalCount($totalCount)
137  {
138  return $this;
139  }
140 
148  public function setItems(array $items = null)
149  {
150  return $this;
151  }
152 }
$resource
Definition: bulk.php:12
$logger
$searchCriteria
$resourceModel
Definition: tablerates.php:10
__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\Sales\Model\ResourceModel\Grid\Document::class, $connection=null, \Magento\Framework\Model\ResourceModel\Db\AbstractDb $resource=null)
Definition: Collection.php:39
setSearchCriteria(\Magento\Framework\Api\SearchCriteriaInterface $searchCriteria=null)
Definition: Collection.php:114
$items