1 | <?php |
||
28 | class Domains extends Field |
||
29 | { |
||
30 | /** |
||
31 | * @var bool |
||
32 | */ |
||
33 | public $unique = true; |
||
34 | |||
35 | /** |
||
36 | * @var int|null The maximum number of relations this field can have (used if [[allowLimit]] is set to true) |
||
37 | */ |
||
38 | public $limit; |
||
39 | |||
40 | /** |
||
41 | * @var bool Whether to allow the Limit setting |
||
42 | */ |
||
43 | public $allowLimit = true; |
||
44 | |||
45 | /** |
||
46 | * @var string |
||
47 | */ |
||
48 | public $defaultStatus = 'pending'; |
||
49 | |||
50 | /** |
||
51 | * @inheritdoc |
||
52 | */ |
||
53 | public static function displayName(): string |
||
57 | |||
58 | /** |
||
59 | * @inheritdoc |
||
60 | */ |
||
61 | public static function hasContentColumn(): bool |
||
65 | |||
66 | /** |
||
67 | * @inheritdoc |
||
68 | */ |
||
69 | public function getElementValidationRules(): array |
||
80 | |||
81 | /** |
||
82 | * @inheritdoc |
||
83 | */ |
||
84 | public function normalizeValue($value, ElementInterface $element = null) |
||
110 | |||
111 | /** |
||
112 | * @param DomainsQuery $query |
||
113 | * @param array $value |
||
114 | * @param ElementInterface|null $element |
||
115 | */ |
||
116 | private function modifyQueryInputValue(DomainsQuery $query, array $value, ElementInterface $element = null) |
||
140 | |||
141 | /** |
||
142 | * @param DomainsQuery $query |
||
143 | */ |
||
144 | private function modifyQueryEmptyValue(DomainsQuery $query) |
||
148 | |||
149 | /** |
||
150 | * @param DomainsQuery $query |
||
151 | * @param string $value |
||
152 | * @param ElementInterface|null $element |
||
153 | */ |
||
154 | private function modifyQuery(DomainsQuery $query, string $value = null, ElementInterface $element = null) |
||
163 | |||
164 | /** |
||
165 | * Returns the site ID that target elements should have. |
||
166 | * |
||
167 | * @param ElementInterface|null $element |
||
168 | * |
||
169 | * @return int |
||
170 | */ |
||
171 | protected function targetSiteId(ElementInterface $element = null): int |
||
182 | |||
183 | /** |
||
184 | * @inheritdoc |
||
185 | */ |
||
186 | public function modifyElementsQuery(ElementQueryInterface $query, $value) |
||
212 | |||
213 | // Events |
||
214 | // ------------------------------------------------------------------------- |
||
215 | |||
216 | /** |
||
217 | * @inheritdoc |
||
218 | */ |
||
219 | public function afterSave(bool $isNew) |
||
224 | |||
225 | /** |
||
226 | * @inheritdoc |
||
227 | */ |
||
228 | public function afterDelete() |
||
233 | |||
234 | /** |
||
235 | * @inheritdoc |
||
236 | */ |
||
237 | public function afterElementSave(ElementInterface $element, bool $isNew) |
||
248 | |||
249 | /** |
||
250 | * @inheritdoc |
||
251 | * |
||
252 | * @param DomainsQuery $value |
||
253 | */ |
||
254 | public function getInputHtml($value, ElementInterface $element = null): string |
||
266 | |||
267 | /** |
||
268 | * Returns the field's input HTML. |
||
269 | * |
||
270 | * @param mixed $value |
||
271 | * @param ElementInterface|null $element |
||
272 | * @param bool $static |
||
273 | * |
||
274 | * @return string |
||
275 | */ |
||
276 | private function getTableHtml($value, ElementInterface $element = null, bool $static): string |
||
317 | |||
318 | /** |
||
319 | * @return array |
||
320 | */ |
||
321 | public function getStatuses(): array |
||
329 | |||
330 | |||
331 | /** |
||
332 | * @param DomainsQuery|null $value |
||
333 | * |
||
334 | * @inheritdoc |
||
335 | */ |
||
336 | public function getSearchKeywords($value, ElementInterface $element): string |
||
350 | } |
||
351 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
integer
values, zero is a special case, in particular the following results might be unexpected: