| Conditions | 3 |
| Paths | 4 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 46 | 39 | public static function getNameFromModel($model) |
|
| 47 | { |
||
| 48 | 39 | $tableName = ''; |
|
| 49 | |||
| 50 | 39 | if (method_exists($model, 'getTableName')) { |
|
| 51 | 39 | $tableName = $model->getTableName(); |
|
| 52 | 39 | } |
|
| 53 | |||
| 54 | 39 | if (isset($model->table)) { |
|
| 55 | 3 | $tableName = $model->table; |
|
| 56 | 3 | } |
|
| 57 | |||
| 58 | 39 | return $tableName; |
|
| 59 | } |
||
| 60 | } |
||
| 61 |