Total Complexity | 7 |
Total Lines | 95 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
9 | class TableMap implements \JsonSerializable |
||
10 | { |
||
11 | /** |
||
12 | * @var string |
||
13 | */ |
||
14 | private $database; |
||
15 | /** |
||
16 | * @var string |
||
17 | */ |
||
18 | private $table; |
||
19 | /** |
||
20 | * @var int |
||
21 | */ |
||
22 | private $tableId; |
||
23 | /** |
||
24 | * @var int |
||
25 | */ |
||
26 | private $columnsAmount; |
||
27 | /** |
||
28 | * @var array |
||
29 | */ |
||
30 | private $fields; |
||
31 | |||
32 | /** |
||
33 | * TableMap constructor. |
||
34 | * @param string $database |
||
35 | * @param string $table |
||
36 | * @param int $tableId |
||
37 | * @param int $columnsAmount |
||
38 | * @param array $fields |
||
39 | */ |
||
40 | 53 | public function __construct( |
|
41 | $database, |
||
42 | $table, |
||
43 | $tableId, |
||
44 | $columnsAmount, |
||
45 | array $fields |
||
46 | ) { |
||
47 | 53 | $this->database = $database; |
|
48 | 53 | $this->table = $table; |
|
49 | 53 | $this->tableId = $tableId; |
|
50 | 53 | $this->columnsAmount = $columnsAmount; |
|
51 | 53 | $this->fields = $fields; |
|
52 | 53 | } |
|
53 | |||
54 | /** |
||
55 | * @return string |
||
56 | */ |
||
57 | 1 | public function getDatabase() |
|
58 | { |
||
59 | 1 | return $this->database; |
|
60 | } |
||
61 | |||
62 | /** |
||
63 | * @return string |
||
64 | */ |
||
65 | 2 | public function getTable() |
|
66 | { |
||
67 | 2 | return $this->table; |
|
68 | } |
||
69 | |||
70 | /** |
||
71 | * @return int |
||
72 | */ |
||
73 | 1 | public function getTableId() |
|
74 | { |
||
75 | 1 | return $this->tableId; |
|
76 | } |
||
77 | |||
78 | /** |
||
79 | * @return int |
||
80 | */ |
||
81 | 52 | public function getColumnsAmount() |
|
82 | { |
||
83 | 52 | return $this->columnsAmount; |
|
84 | } |
||
85 | |||
86 | /** |
||
87 | * @return array |
||
88 | */ |
||
89 | 53 | public function getFields() |
|
92 | } |
||
93 | |||
94 | /** |
||
95 | * Specify data which should be serialized to JSON |
||
96 | * @link http://php.net/manual/en/jsonserializable.jsonserialize.php |
||
97 | * @return mixed data which can be serialized by <b>json_encode</b>, |
||
98 | * which is a value of any type other than a resource. |
||
99 | * @since 5.4.0 |
||
100 | */ |
||
101 | 1 | public function jsonSerialize() |
|
104 | } |
||
105 | } |