| Total Complexity | 5 |
| Total Lines | 50 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 2 | ||
| Bugs | 0 | Features | 2 |
| 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 | 4 | public function getMorphValue(): string |
|
| 27 | { |
||
| 28 | 4 | if ($this->morphValue == null) { |
|
| 29 | 4 | $this->initMorphValue(); |
|
| 30 | } |
||
| 31 | 4 | return $this->morphValue; |
|
| 32 | } |
||
| 33 | |||
| 34 | /** |
||
| 35 | * @param string $morphValue |
||
| 36 | */ |
||
| 37 | 4 | public function setMorphValue(string $morphValue) |
|
| 38 | { |
||
| 39 | 4 | $this->morphValue = $morphValue; |
|
| 40 | 4 | } |
|
| 41 | |||
| 42 | /** |
||
| 43 | * @return string |
||
| 44 | */ |
||
| 45 | 4 | protected function initMorphValue() |
|
| 49 | ); |
||
| 50 | 4 | } |
|
| 51 | |||
| 52 | /** |
||
| 53 | * @param $params |
||
| 54 | * @throws \Exception |
||
| 55 | */ |
||
| 56 | 1 | public function addParams($params) |
|
| 63 |