| Conditions | 5 |
| Paths | 6 |
| Total Lines | 17 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 5 |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | 36 | public static function getModelName($table, $currentTable, $isForeignKey = false) |
|
| 22 | { |
||
| 23 | 36 | $tableName = $table; |
|
| 24 | |||
| 25 | 36 | if (! $isForeignKey && $currentTable) { |
|
| 26 | 24 | $tableName = $currentTable; |
|
| 27 | |||
| 28 | 24 | if (is_object($currentTable)) { |
|
| 29 | 9 | $tableName = $currentTable->getTableName(); |
|
| 30 | 9 | } |
|
| 31 | 24 | } |
|
| 32 | |||
| 33 | 36 | $tableName = ucfirst(singular($tableName)); |
|
| 34 | 36 | $tableNames = explode('.', $tableName); |
|
| 35 | |||
| 36 | 36 | return isset($tableNames[1]) ? $tableNames[1] : $tableName; |
|
| 37 | } |
||
| 38 | |||
| 61 |