Conditions | 2 |
Paths | 2 |
Total Lines | 19 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
19 | public function getTable($class) |
||
20 | { |
||
21 | $ref = new \ReflectionClass($class); |
||
22 | $qb = new QueryBuilder(); |
||
23 | $util = new Utils(); |
||
24 | |||
25 | if ($ref->hasProperty('table')) { |
||
26 | $tableCheck = $ref->getProperty('table'); |
||
27 | $tableCheck->setAccessible(true); |
||
28 | $tableName = $tableCheck->getValue(new $class()); |
||
29 | } else { |
||
30 | $tableName = explode('\\', $class); |
||
31 | $tableName = $util->decamelize(end($tableName)); |
||
32 | } |
||
33 | |||
34 | $prefix = $qb->getPrefix(); |
||
35 | $table = $prefix.$tableName; |
||
36 | |||
37 | return $table; |
||
38 | } |
||
40 |