| Conditions | 3 |
| Paths | 4 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 3 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 36 | 39 | public static function getNameFromModel($model) |
|
| 37 | { |
||
| 38 | 39 | $tableName = ''; |
|
| 39 | |||
| 40 | 39 | if (method_exists($model, 'getTableName')) { |
|
| 41 | 39 | $tableName = $model->getTableName(); |
|
| 42 | 39 | } |
|
| 43 | |||
| 44 | 39 | if (isset($model->table)) { |
|
| 45 | 3 | $tableName = $model->table; |
|
| 46 | 3 | } |
|
| 47 | |||
| 48 | 39 | return $tableName; |
|
| 49 | } |
||
| 50 | } |
||
| 51 |