1 | <?php |
||
21 | abstract class SingularRelation extends AbstractRelation |
||
22 | { |
||
23 | use SyncedTrait; |
||
24 | |||
25 | /** |
||
26 | * Create placeholder model when relation is empty. |
||
27 | */ |
||
28 | const CREATE_PLACEHOLDER = false; |
||
29 | |||
30 | /** |
||
31 | * @var RecordInterface |
||
32 | */ |
||
33 | protected $instance; |
||
34 | |||
35 | /** |
||
36 | * {@inheritdoc} |
||
37 | */ |
||
38 | public function hasRelated(): bool |
||
47 | |||
48 | /** |
||
49 | * {@inheritdoc} |
||
50 | * |
||
51 | * Returns associated parent or NULL if none associated. |
||
52 | */ |
||
53 | public function getRelated() |
||
86 | |||
87 | /** |
||
88 | * {@inheritdoc} |
||
89 | * |
||
90 | * @throws SelectorException |
||
91 | * @throws QueryException |
||
92 | */ |
||
93 | protected function loadData() |
||
114 | |||
115 | /** |
||
116 | * Where statement to load outer record. |
||
117 | * |
||
118 | * @return array |
||
119 | */ |
||
120 | protected function whereStatement(): array |
||
126 | |||
127 | /** |
||
128 | * @return bool |
||
129 | */ |
||
130 | protected function isPlaceholderNeeded(): bool |
||
134 | } |