1 | <?php |
||
25 | trait NormalizeValueTrait |
||
26 | { |
||
27 | /** |
||
28 | * @return string |
||
29 | */ |
||
30 | abstract public static function recordClass(): string; |
||
31 | |||
32 | /******************************************* |
||
33 | * NORMALIZE VALUE |
||
34 | *******************************************/ |
||
35 | |||
36 | /** |
||
37 | * @param $value |
||
38 | * @param ElementInterface|null $element |
||
39 | * @return IntegrationAssociationQuery |
||
40 | */ |
||
41 | public function normalizeValue( |
||
52 | |||
53 | /** |
||
54 | * @param ElementInterface|null $element |
||
55 | * @return IntegrationAssociationQuery |
||
56 | */ |
||
57 | protected function getQuery( |
||
78 | |||
79 | /** |
||
80 | * @param IntegrationAssociationQuery $query |
||
81 | * @param ElementInterface|null $element |
||
82 | */ |
||
83 | protected function normalizeQuery( |
||
91 | |||
92 | /** |
||
93 | * @param IntegrationAssociationQuery $query |
||
94 | * @param $value |
||
95 | * @param ElementInterface|null $element |
||
96 | */ |
||
97 | protected function normalizeQueryValue( |
||
114 | |||
115 | /** |
||
116 | * @param IntegrationAssociationQuery $query |
||
117 | * @param array $value |
||
118 | * @param ElementInterface|null $element |
||
119 | */ |
||
120 | protected function normalizeQueryInputValues( |
||
132 | |||
133 | /** |
||
134 | * @param $value |
||
135 | * @param int $sortOrder |
||
136 | * @param ElementInterface|null $element |
||
137 | * @return IntegrationAssociationQuery |
||
138 | */ |
||
139 | protected function normalizeQueryInputValue( |
||
163 | |||
164 | /** |
||
165 | * @param IntegrationAssociationQuery $query |
||
166 | */ |
||
167 | protected function normalizeQueryEmptyValue( |
||
172 | |||
173 | |||
174 | /** |
||
175 | * Returns the site ID that target elements should have. |
||
176 | * |
||
177 | * @param ElementInterface|Element|null $element |
||
178 | * |
||
179 | * @return int |
||
180 | */ |
||
181 | protected function targetSiteId(ElementInterface $element = null): int |
||
190 | } |
||
191 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: