Conditions | 3 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
37 | public function getDepthRelatedTo(Model $model): ?int |
||
38 | { |
||
39 | $thisModel = $this->bloodline->find($this); |
||
40 | $relatedModel = $this->bloodline->find($model); |
||
41 | |||
42 | if ($thisModel && $relatedModel) { |
||
43 | $depthName = $this->getDepthName(); |
||
|
|||
44 | |||
45 | return $thisModel->$depthName - $relatedModel->$depthName; |
||
46 | } |
||
47 | |||
48 | return null; |
||
49 | } |
||
51 |