Total Complexity | 12 |
Total Lines | 89 |
Duplicated Lines | 0 % |
Coverage | 87.5% |
Changes | 0 |
1 | <?php |
||
10 | class Column implements IPillarAnnotation |
||
11 | { |
||
12 | /** |
||
13 | * @var string |
||
14 | * @Required() |
||
15 | */ |
||
16 | protected $name; |
||
17 | |||
18 | /** |
||
19 | * @var string |
||
20 | * @Required() |
||
21 | */ |
||
22 | protected $table; |
||
23 | |||
24 | /** |
||
25 | * @var string|null |
||
26 | */ |
||
27 | protected $customSelect; |
||
28 | |||
29 | /** |
||
30 | * @var bool |
||
31 | */ |
||
32 | protected $deprecated = false; |
||
33 | |||
34 | /** |
||
35 | * @var bool |
||
36 | */ |
||
37 | protected $primary = false; |
||
38 | |||
39 | 6 | public function __construct($values) |
|
40 | { |
||
41 | 6 | if (isset($values['value'])) { |
|
42 | $this->name = $values['value']; |
||
43 | } |
||
44 | 6 | if (isset($values['name'])) { |
|
45 | 6 | $this->name = $values['name']; |
|
46 | } |
||
47 | 6 | if (isset($values['table'])) { |
|
48 | 6 | $this->table = $values['table']; |
|
49 | } |
||
50 | 6 | if (isset($values['primary'])) { |
|
51 | 6 | $this->primary = $values['primary']; |
|
52 | } |
||
53 | 6 | if (isset($values['deprecated'])) { |
|
54 | $this->deprecated = $values['deprecated']; |
||
55 | } |
||
56 | 6 | if (isset($values['customSelect'])) { |
|
57 | $this->customSelect = $values['customSelect']; |
||
58 | } |
||
59 | 6 | } |
|
60 | |||
61 | /** |
||
62 | * @return string |
||
63 | */ |
||
64 | 6 | public function getName() |
|
65 | { |
||
66 | 6 | return $this->name; |
|
67 | } |
||
68 | |||
69 | /** |
||
70 | * @return string |
||
71 | */ |
||
72 | 6 | public function getTable() |
|
73 | { |
||
74 | 6 | return $this->table; |
|
75 | } |
||
76 | |||
77 | /** |
||
78 | * @return bool |
||
79 | */ |
||
80 | 6 | public function isPrimary() |
|
81 | { |
||
82 | 6 | return $this->primary; |
|
83 | } |
||
84 | |||
85 | /** |
||
86 | * @return bool |
||
87 | */ |
||
88 | 6 | public function isDeprecated() |
|
91 | } |
||
92 | |||
93 | /** |
||
94 | * @return string|null |
||
95 | */ |
||
96 | 6 | public function getCustomSelect() |
|
99 | } |
||
100 | } |
||
101 |