Total Complexity | 4 |
Total Lines | 46 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
5 | class SubQueryList extends AbstractList |
||
6 | { |
||
7 | /** |
||
8 | * {@inheritdoc} |
||
9 | */ |
||
10 | protected $separator = ','; |
||
11 | |||
12 | /** |
||
13 | * Magic method __invoke, used when the user call object like a function |
||
14 | * @link http://php.net/manual/en/language.oop5.magic.php#object.invoke |
||
15 | * |
||
16 | * @param string $shortcut The shortcut to use into the request |
||
17 | * @param string|\BfwSql\Queries\AbstractQuery $subQuery The sub-query |
||
18 | * |
||
19 | * @return void |
||
20 | */ |
||
21 | public function __invoke(string $shortcut, $subQuery) |
||
22 | { |
||
23 | $this->invokeCheckIsDisabled(); |
||
24 | |||
25 | $usedClass = \BfwSql\UsedClass::getInstance(); |
||
26 | $subQueryClass = $usedClass->obtainClassNameToUse('QueriesPartsSubQuery'); |
||
27 | |||
28 | $this->list[] = new $subQueryClass($this->querySystem, $shortcut, $subQuery); |
||
29 | } |
||
30 | |||
31 | /** |
||
32 | * {@inheritdoc} |
||
33 | */ |
||
34 | public function generate(): string |
||
51 | } |
||
52 | } |
||
53 |