StatementFieldEntity   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 98
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 20
c 1
b 0
f 0
dl 0
loc 98
rs 10
wmc 8

8 Methods

Rating   Name   Duplication   Size   Complexity  
A isBinary() 0 3 1
A table() 0 3 1
A name() 0 3 1
A orgName() 0 3 1
A type() 0 3 1
A orgTable() 0 3 1
A tableName() 0 3 1
A __construct() 0 9 1
1
<?php
2
3
namespace Lagdo\DbAdmin\Driver\Entity;
4
5
class StatementFieldEntity
6
{
7
    /**
8
     * The field type
9
     *
10
     * @var string
11
     */
12
    protected $type = '';
13
14
    /**
15
     * If the field is binary
16
     *
17
     * @var bool
18
     */
19
    protected $isBinary = false;
20
21
    /**
22
     * The field name
23
     *
24
     * @var string
25
     */
26
    protected $name = '';
27
28
    /**
29
     * The field org name
30
     *
31
     * @var string
32
     */
33
    protected $orgName = '';
34
35
    /**
36
     * The field table name
37
     *
38
     * @var string
39
     */
40
    protected $table = '';
41
42
    /**
43
     * The field org table name
44
     *
45
     * @var string
46
     */
47
    protected $orgTable = '';
48
49
    /**
50
     * The constructor
51
     *
52
     * @param string $type
53
     * @param boolean $isBinary
54
     * @param string $name
55
     * @param string $orgName
56
     * @param string $table
57
     * @param string $orgTable
58
     */
59
    public function __construct(string $type, bool $isBinary,
60
        string $name, string $orgName, string $table = '', string $orgTable = '')
61
    {
62
        $this->type = $type;
63
        $this->isBinary = $isBinary;
64
        $this->name = $name;
65
        $this->orgName = $orgName;
66
        $this->table = $table;
67
        $this->orgTable = $orgTable;
68
    }
69
70
    public function type()
71
    {
72
        return $this->type;
73
    }
74
75
    public function isBinary()
76
    {
77
        return $this->isBinary;
78
    }
79
80
    public function name()
81
    {
82
        return $this->name;
83
    }
84
85
    public function orgName()
86
    {
87
        return $this->orgName;
88
    }
89
90
    public function table()
91
    {
92
        return $this->table;
93
    }
94
95
    public function orgTable()
96
    {
97
        return $this->orgTable;
98
    }
99
100
    public function tableName()
101
    {
102
        return $this->table ?? $this->orgTable;
103
    }
104
}
105