Total Complexity | 1 |
Total Lines | 21 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | final class Options |
||
11 | { |
||
12 | /** |
||
13 | * @readonly |
||
14 | */ |
||
15 | public bool $ignoreUninitializedRelations = true; |
||
16 | |||
17 | /** |
||
18 | * If TRUE, ORM will ignore relations on uninitialized Entity properties. |
||
19 | * In this case, `unset($entity->relation)` will not change the relation when saving, |
||
20 | * and it will hydrate it if the relation is loaded in the query. |
||
21 | * |
||
22 | * If FALSE, uninitialized properties will be treated as NULL (an empty collection or empty value). |
||
23 | * `unset($entity->relation)` will lead to a change in the relation |
||
24 | * (removing the link with another entity or entities). |
||
25 | */ |
||
26 | public function withIgnoreUninitializedRelations(bool $value): static |
||
33 |