| Total Complexity | 4 |
| Total Lines | 38 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | class OneToMany extends OneToOne |
||
| 10 | { |
||
| 11 | protected $type = RelationConfig::TYPE_ONE_TO_MANY; |
||
| 12 | |||
| 13 | protected $cascade; |
||
| 14 | |||
| 15 | protected $aggregates = []; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @return bool |
||
| 19 | */ |
||
| 20 | public function getCascade() |
||
| 21 | { |
||
| 22 | return $this->cascade; |
||
| 23 | } |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @param bool $cascade |
||
| 27 | * |
||
| 28 | * @return Relation |
||
| 29 | */ |
||
| 30 | public function setCascade(bool $cascade) |
||
| 31 | { |
||
| 32 | $this->cascade = $cascade; |
||
| 33 | |||
| 34 | return $this; |
||
| 35 | } |
||
| 36 | |||
| 37 | public function addAggregate($name, $aggregate) |
||
| 38 | { |
||
| 39 | $this->aggregates[$name] = $aggregate; |
||
| 40 | |||
| 41 | return $this; |
||
| 42 | } |
||
| 43 | |||
| 44 | public function getAggregates(): array |
||
| 45 | { |
||
| 46 | return $this->aggregates; |
||
| 47 | } |
||
| 49 |