TableGateway   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
c 2
b 0
f 0
lcom 0
cbo 4
dl 0
loc 13
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 2
1
<?php
2
3
namespace Silk\Database;
4
5
use PhpDocReader\Reader;
6
use Silk\Exceptions\NoTableFoundException;
7
use Zend\Db\TableGateway\AbstractTableGateway;
8
use Zend\Db\TableGateway\Feature\GlobalAdapterFeature;
9
10
/**
11
 * Class TableGateway
12
 * @author  Lucas A. de Araújo <[email protected]>
13
 * @package Silk\Database
14
 */
15
class TableGateway extends AbstractTableGateway
16
{
17
    public function __construct($object)
18
    {
19
        $config = Reader::getConfig($object);
20
21
        if (!array_key_exists('table', $config))
22
            throw new NoTableFoundException();
23
24
        $this->table = $config['table'];
25
        $this->adapter = GlobalAdapterFeature::getStaticAdapter();
26
    }
27
}