Passed
Push — master ( 1888ff...f2e9e8 )
by Hector Luis
28:29
created

Base   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 7
c 1
b 0
f 0
dl 0
loc 27
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A _construct() 0 3 1
A __construct() 0 9 1
1
<?php
2
declare(strict_types=1);
3
4
/**
5
 * Entity Resource Class
6
 * @package Ticaje_Persistence
7
 * @author Hector Luis Barrientos <[email protected]>
8
 */
9
10
namespace Ticaje\Base\Resource\Persistence\Entity\Resource;
11
12
use Magento\Framework\Model\ResourceModel\Db\AbstractDb;
13
use Magento\Framework\Model\ResourceModel\Db\Context as ParentContext;
14
15
/**
16
 * Class Base
17
 * @package Ticaje\Base\Resource\Persistence\Entity\Resource
18
 */
19
class Base extends AbstractDb
20
{
21
    private $tableName;
22
23
    private $referenceId;
24
25
    /**
26
     * Base constructor.
27
     * @param ParentContext $context
28
     * @param null $connectionName
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $connectionName is correct as it would always require null to be passed?
Loading history...
29
     * @param string $tableName
30
     * @param string $referenceId
31
     */
32
    public function __construct(
33
        ParentContext $context,
34
        $connectionName = null,
35
        string $tableName,
36
        string $referenceId
37
    ) {
38
        $this->tableName = $tableName;
39
        $this->referenceId = $referenceId;
40
        parent::__construct($context, $connectionName);
41
    }
42
43
    protected function _construct()
44
    {
45
        $this->_init($this->tableName, $this->referenceId);
46
    }
47
}
48