Total Complexity | 1 |
Total Lines | 38 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
16 | class BelongsTo extends AbstractSchema |
||
17 | { |
||
18 | use FieldTrait; |
||
19 | |||
20 | protected const RELATION_TYPE = Relation::HAS_ONE; |
||
21 | |||
22 | protected const OPTION_SCHEMA = [ |
||
23 | // save with parent |
||
24 | Relation::CASCADE => true, |
||
25 | |||
26 | // use outer entity constrain by default |
||
27 | Relation::CONSTRAIN => true, |
||
28 | |||
29 | // nullable by default |
||
30 | Relation::NULLABLE => true, |
||
31 | |||
32 | // link to parent entity primary key by default |
||
33 | Relation::INNER_KEY => '{relation}_{outerKey}', |
||
34 | |||
35 | // default field name for inner key |
||
36 | Relation::OUTER_KEY => '{target:primaryKey}', |
||
37 | ]; |
||
38 | |||
39 | /** |
||
40 | * @param Registry $registry |
||
41 | */ |
||
42 | public function compute(Registry $registry) |
||
56 | } |