Total Complexity | 6 |
Total Lines | 54 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | class QueryRelationManager extends QueryRelationManagerBase |
||
14 | { |
||
15 | /** |
||
16 | * @inheritDoc |
||
17 | */ |
||
18 | protected function getTableName(string $className): string |
||
19 | { |
||
20 | return $className; |
||
21 | } |
||
22 | |||
23 | /** |
||
24 | * @inheritDoc |
||
25 | */ |
||
26 | protected function createQuery(): QueryWrapperInterface |
||
29 | } |
||
30 | |||
31 | /** |
||
32 | * @inheritDoc |
||
33 | * @throws QueryRelationManagerException |
||
34 | */ |
||
35 | protected function getTableFields(string $className): array |
||
36 | { |
||
37 | $qw = new QueryWrapper(); |
||
38 | $qw->setRawSql('SHOW COLUMNS FROM '.addslashes($className)); |
||
39 | $rows = $qw->all(); |
||
40 | |||
41 | /** @var array<string> $result */ |
||
42 | $result = []; |
||
43 | foreach($rows as $row) { |
||
44 | $result[] = $row['Field']; |
||
45 | } |
||
46 | |||
47 | return $result; |
||
48 | } |
||
49 | |||
50 | /** |
||
51 | * @inheritDoc |
||
52 | * @throws QueryRelationManagerException |
||
53 | */ |
||
54 | protected function getPrimaryKey(string $className): array |
||
67 | } |
||
68 | } |
||
69 |