| Total Complexity | 3 |
| Total Lines | 28 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 17 | trait HasOne |
||
| 18 | { |
||
| 19 | /** |
||
| 20 | * Get the data for a 'belongs to' relationship |
||
| 21 | * |
||
| 22 | * @param string $modelClass The model class that we 'belong to' |
||
| 23 | * @param string $attribute The local data attribute that identifies the 'belongs to' key |
||
| 24 | * @param string $foreignAttribute The foreign data attribute that the local field references |
||
| 25 | * @return \Ronanchilvers\Orm\Model |
||
| 26 | * @author Ronan Chilvers <[email protected]> |
||
| 27 | */ |
||
| 28 | protected function hasOne(string $modelClass, string $foreignAttribute = null, string $attribute = 'id') |
||
| 47 |