Conditions | 4 |
Paths | 4 |
Total Lines | 17 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
25 | protected function parseIds($value) |
||
26 | { |
||
27 | if ($value instanceof Model) { |
||
28 | return [$this->executeWithinOptionalBinaryTransformation(function() use ($value) { |
||
29 | return $value->{$this->relatedKey}; |
||
30 | }, $value)]; |
||
31 | } |
||
32 | |||
33 | if ($value instanceof Collection) { |
||
34 | return $value->pluck($this->relatedKey)->all(); |
||
35 | } |
||
36 | |||
37 | if ($value instanceof BaseCollection) { |
||
38 | return $value->toArray(); |
||
39 | } |
||
40 | |||
41 | return (array) $value; |
||
42 | } |
||
57 | } |