1 | <?php |
||
22 | class BelongsToMorphedRelation extends SingularRelation |
||
23 | { |
||
24 | use LookupTrait; |
||
25 | |||
26 | /** |
||
27 | * Always saved before parent. |
||
28 | */ |
||
29 | const LEADING_RELATION = true; |
||
30 | |||
31 | /** |
||
32 | * No placeholder for belongs to. |
||
33 | */ |
||
34 | const CREATE_PLACEHOLDER = false; |
||
35 | |||
36 | /** |
||
37 | * {@inheritdoc} |
||
38 | */ |
||
39 | public function getClass(): string |
||
48 | |||
49 | /** |
||
50 | * {@inheritdoc} |
||
51 | */ |
||
52 | public function setRelated($value) |
||
60 | |||
61 | /** |
||
62 | * @param ContextualCommandInterface $parentCommand |
||
63 | * |
||
64 | * @return CommandInterface |
||
65 | * |
||
66 | * @throws RelationException |
||
67 | */ |
||
68 | public function queueCommands(ContextualCommandInterface $parentCommand): CommandInterface |
||
83 | |||
84 | /** |
||
85 | * {@inheritdoc} |
||
86 | */ |
||
87 | protected function getRoles(): array |
||
91 | |||
92 | /** |
||
93 | * Store related instance |
||
94 | * |
||
95 | * @param ContextualCommandInterface $parentCommand |
||
96 | * |
||
97 | * @return ContextualCommandInterface |
||
98 | */ |
||
99 | private function queueRelated( |
||
123 | } |