1
|
|
|
<?php |
2
|
|
|
declare(strict_types=1); |
3
|
|
|
|
4
|
|
|
/** |
5
|
|
|
* Entity Collection Class |
6
|
|
|
* @package Ticaje_Circuitable |
7
|
|
|
* @author Hector Luis Barrientos <[email protected]> |
8
|
|
|
*/ |
9
|
|
|
|
10
|
|
|
namespace Ticaje\Base\Persistence\Entity\Resource\Collection; |
11
|
|
|
|
12
|
|
|
use Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection; |
13
|
|
|
use Magento\Framework\Data\Collection\EntityFactoryInterface; |
14
|
|
|
use Psr\Log\LoggerInterface; |
15
|
|
|
use Magento\Framework\Data\Collection\Db\FetchStrategyInterface; |
16
|
|
|
use Magento\Framework\Event\ManagerInterface; |
17
|
|
|
use Magento\Framework\DB\Adapter\AdapterInterface; |
18
|
|
|
use Magento\Framework\Model\ResourceModel\Db\AbstractDb; |
19
|
|
|
|
20
|
|
|
/** |
21
|
|
|
* Class Base |
22
|
|
|
* @package Ticaje\Base\Persistence\Entity\Resource\Collection |
23
|
|
|
*/ |
24
|
|
|
class Base extends AbstractCollection |
25
|
|
|
{ |
26
|
|
|
/** |
27
|
|
|
* Base constructor. |
28
|
|
|
* @param EntityFactoryInterface $entityFactory |
29
|
|
|
* @param LoggerInterface $logger |
30
|
|
|
* @param FetchStrategyInterface $fetchStrategy |
31
|
|
|
* @param ManagerInterface $eventManager |
32
|
|
|
* @param AdapterInterface|null $connection |
33
|
|
|
* @param AbstractDb|null $resource |
34
|
|
|
* @param string $idFieldName |
35
|
|
|
* @param string $model |
36
|
|
|
* @param string $resourceModel |
37
|
|
|
*/ |
38
|
|
|
public function __construct( |
39
|
|
|
EntityFactoryInterface $entityFactory, |
40
|
|
|
LoggerInterface $logger, |
41
|
|
|
FetchStrategyInterface $fetchStrategy, |
42
|
|
|
ManagerInterface $eventManager, |
43
|
|
|
AdapterInterface $connection = null, |
44
|
|
|
AbstractDb $resource = null, |
45
|
|
|
string $idFieldName, |
46
|
|
|
string $model, |
47
|
|
|
string $resourceModel |
48
|
|
|
) { |
49
|
|
|
$this->_idFieldName = $idFieldName; |
50
|
|
|
$this->_model = $model; |
51
|
|
|
$this->_resourceModel = $resourceModel; |
52
|
|
|
parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource); |
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
protected function _construct() |
56
|
|
|
{ |
57
|
|
|
$this->_init($this->_model, $this->_resourceModel); |
58
|
|
|
} |
59
|
|
|
} |
60
|
|
|
|