1 | <?php |
||
9 | class Options |
||
10 | { |
||
11 | private $tableName = ''; |
||
12 | |||
13 | private $sequenceName = null; |
||
14 | |||
15 | private $idColumnName = ''; |
||
16 | |||
17 | private $leftColumnName = 'lft'; |
||
18 | private $rightColumnName = 'rgt'; |
||
19 | private $levelColumnName = 'level'; |
||
20 | private $parentIdColumnName = 'parent_id'; |
||
21 | private $scopeColumnName = null; |
||
22 | |||
23 | /** |
||
24 | * @param array $options |
||
25 | * |
||
26 | * @throws InvalidArgumentException |
||
27 | */ |
||
28 | 238 | public function __construct(array $options) |
|
43 | |||
44 | /** |
||
45 | * @param array $options |
||
46 | */ |
||
47 | 237 | protected function setOptions(array $options): void |
|
56 | |||
57 | /** |
||
58 | * @param string $tableName |
||
59 | * |
||
60 | * @throws InvalidArgumentException |
||
61 | */ |
||
62 | 237 | public function setTableName(string $tableName): void |
|
72 | |||
73 | /** |
||
74 | * @return string |
||
75 | */ |
||
76 | 207 | public function getTableName(): string |
|
80 | |||
81 | /** |
||
82 | * @param string $sequenceName |
||
83 | */ |
||
84 | 1 | public function setSequenceName(string $sequenceName): void |
|
88 | |||
89 | /** |
||
90 | * @return string|null |
||
91 | */ |
||
92 | 19 | public function getSequenceName(): ?string |
|
96 | |||
97 | /** |
||
98 | * @param string $idColumnName |
||
99 | * |
||
100 | * @throws InvalidArgumentException |
||
101 | */ |
||
102 | 237 | public function setIdColumnName(string $idColumnName): void |
|
112 | |||
113 | /** |
||
114 | * @param bool $withTableName |
||
115 | * |
||
116 | * @return string |
||
117 | */ |
||
118 | 167 | public function getIdColumnName(bool $withTableName = false): string |
|
122 | |||
123 | /** |
||
124 | * @param string $leftColumnName |
||
125 | * |
||
126 | * @throws InvalidArgumentException |
||
127 | */ |
||
128 | 2 | public function setLeftColumnName(string $leftColumnName): void |
|
138 | |||
139 | /** |
||
140 | * @param bool $withTableName |
||
141 | * |
||
142 | * @return string |
||
143 | */ |
||
144 | 143 | public function getLeftColumnName(bool $withTableName = false): string |
|
148 | |||
149 | /** |
||
150 | * @param string $rightColumnName |
||
151 | * |
||
152 | * @throws InvalidArgumentException |
||
153 | */ |
||
154 | 2 | public function setRightColumnName(string $rightColumnName): void |
|
164 | |||
165 | /** |
||
166 | * @param bool $withTableName |
||
167 | * |
||
168 | * @return string |
||
169 | */ |
||
170 | 142 | public function getRightColumnName(bool $withTableName = false): string |
|
174 | |||
175 | /** |
||
176 | * @param string $levelColumnName |
||
177 | * |
||
178 | * @throws InvalidArgumentException |
||
179 | */ |
||
180 | 2 | public function setLevelColumnName(string $levelColumnName): void |
|
190 | |||
191 | /** |
||
192 | * @param bool $withTableName |
||
193 | * |
||
194 | * @return string |
||
195 | */ |
||
196 | 130 | public function getLevelColumnName(bool $withTableName = false): string |
|
200 | |||
201 | /** |
||
202 | * @param string $parentIdColumnName |
||
203 | * |
||
204 | * @throws InvalidArgumentException |
||
205 | */ |
||
206 | 2 | public function setParentIdColumnName(string $parentIdColumnName): void |
|
216 | |||
217 | /** |
||
218 | * @param bool $withTableName |
||
219 | * |
||
220 | * @return string |
||
221 | */ |
||
222 | 138 | public function getParentIdColumnName(bool $withTableName = false): string |
|
226 | |||
227 | /** |
||
228 | * @param $scopeColumnName |
||
229 | */ |
||
230 | 76 | public function setScopeColumnName(string $scopeColumnName): void |
|
234 | |||
235 | /** |
||
236 | * @param bool $withTableName |
||
237 | * |
||
238 | * @return string|null |
||
239 | */ |
||
240 | 146 | public function getScopeColumnName(bool $withTableName = false): ?string |
|
244 | |||
245 | 141 | private function addTableName(?string $value): ?string |
|
253 | } |
||
254 |