Total Complexity | 1 |
Total Lines | 30 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
15 | class HasOne extends AbstractSchema |
||
16 | { |
||
17 | /** |
||
18 | * {@inheritdoc} |
||
19 | */ |
||
20 | protected const OPTION_SCHEMA = [ |
||
21 | // save with parent |
||
22 | Relation::CASCADE => true, |
||
23 | |||
24 | // not nullable by default |
||
25 | Relation::NULLABLE => false, |
||
26 | |||
27 | // use outer entity constrain by default |
||
28 | Relation::CONSTRAIN => true, |
||
29 | |||
30 | // link to parent entity primary key by default |
||
31 | Relation::INNER_KEY => '{source:primaryKey}', |
||
32 | |||
33 | // default field name for inner key |
||
34 | Relation::OUTER_KEY => '{source:role}_{innerKey}', |
||
35 | ]; |
||
36 | |||
37 | public function compute(Registry $registry) |
||
45 | } |
||
46 | } |