1 | <?php |
||
11 | abstract class MorphOneOrMany extends HasOneOrMany |
||
12 | { |
||
13 | use HasMorphTypeTrait; |
||
14 | |||
15 | /** |
||
16 | * The class name of model manager |
||
17 | * This value is saved in the morph type collumn |
||
18 | * |
||
19 | * @var string |
||
20 | */ |
||
21 | protected $morphValue = null; |
||
22 | |||
23 | /** |
||
24 | * @return string |
||
25 | */ |
||
26 | 2 | public function getMorphValue(): string |
|
33 | |||
34 | /** |
||
35 | * @param string $morphValue |
||
36 | */ |
||
37 | 2 | public function setMorphValue(string $morphValue) |
|
41 | |||
42 | /** |
||
43 | * @return string |
||
44 | */ |
||
45 | 2 | protected function initMorphValue() |
|
51 | } |
||
52 |
If you implement
__call
and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.This is often the case, when
__call
is implemented by a parent class and only the child class knows which methods exist: