| Conditions | 3 |
| Paths | 2 |
| Total Lines | 10 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 24 | public function depthRelatedTo(Model $model) |
||
| 25 | { |
||
| 26 | $currentModel = $this->bloodline->firstWhere('id', $this->getKey()); |
||
|
|
|||
| 27 | $relatedModel = $this->bloodline->firstWhere('id', $model->getKey()); |
||
| 28 | |||
| 29 | if ($currentModel && $relatedModel) { |
||
| 30 | return $currentModel->depth - $relatedModel->depth; |
||
| 31 | } |
||
| 32 | |||
| 33 | return null; |
||
| 34 | } |
||
| 36 |