-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Expand file tree
/
Copy pathCollection.php
More file actions
54 lines (50 loc) · 1.92 KB
/
Collection.php
File metadata and controls
54 lines (50 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
/**
* Copyright 2015 Adobe
* All Rights Reserved.
*/
namespace Magento\Eav\Model\ResourceModel\Entity\Attribute\Grid;
use Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection;
/**
* Eav Resource Attribute Set Collection
*/
class Collection extends \Magento\Eav\Model\ResourceModel\Entity\Attribute\Set\Collection
{
/**
* @var \Magento\Framework\Registry
*/
protected $_registryManager;
/**
* @param \Magento\Framework\Data\Collection\EntityFactory $entityFactory
* @param \Psr\Log\LoggerInterface $logger
* @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy
* @param \Magento\Framework\Event\ManagerInterface $eventManager
* @param \Magento\Framework\Registry $registryManager
* @param mixed $connection
* @param \Magento\Framework\Model\ResourceModel\Db\AbstractDb $resource
* @codeCoverageIgnore
*/
public function __construct(
\Magento\Framework\Data\Collection\EntityFactory $entityFactory,
\Psr\Log\LoggerInterface $logger,
\Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy,
\Magento\Framework\Event\ManagerInterface $eventManager,
\Magento\Framework\Registry $registryManager,
?\Magento\Framework\DB\Adapter\AdapterInterface $connection = null,
?\Magento\Framework\Model\ResourceModel\Db\AbstractDb $resource = null
) {
$this->_registryManager = $registryManager;
parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource);
}
/**
* Add filter by entity type id to collection
*
* @return \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection|$this
*/
protected function _initSelect()
{
parent::_initSelect();
$this->setEntityTypeFilter($this->_registryManager->registry('entityType'));
return $this;
}
}