1 | <?php |
||
28 | class Link extends Field implements PreviewableFieldInterface |
||
29 | { |
||
30 | |||
31 | /** |
||
32 | * Type objects that have been configured via the admin |
||
33 | * |
||
34 | * @var TypeInterface[] |
||
35 | */ |
||
36 | protected $types = []; |
||
37 | |||
38 | /** |
||
39 | * Raw configurations that have been configured via the admin |
||
40 | * |
||
41 | * @var array |
||
42 | */ |
||
43 | protected $typeConfigs = []; |
||
44 | |||
45 | /** |
||
46 | * @return TypeInterface[] |
||
47 | * @throws \yii\base\InvalidConfigException |
||
48 | */ |
||
49 | public function getTypes() |
||
56 | |||
57 | /** |
||
58 | * @param array $types |
||
59 | * @return $this |
||
60 | */ |
||
61 | public function setTypes(array $types) |
||
69 | |||
70 | /** |
||
71 | * @param string $identifier |
||
72 | * @return TypeInterface|null |
||
73 | * @throws \yii\base\InvalidConfigException |
||
74 | */ |
||
75 | public function getType(string $identifier) |
||
89 | |||
90 | /** |
||
91 | * @inheritdoc |
||
92 | */ |
||
93 | public static function displayName(): string |
||
97 | |||
98 | /** |
||
99 | * @inheritdoc |
||
100 | */ |
||
101 | public function getContentColumnType(): string |
||
105 | |||
106 | /** |
||
107 | * @inheritdoc |
||
108 | */ |
||
109 | public function getTableAttributeHtml($value, ElementInterface $element): string |
||
117 | |||
118 | /** |
||
119 | * @inheritdoc |
||
120 | * @throws \Twig_Error_Loader |
||
121 | * @throws \yii\base\Exception |
||
122 | * @throws \yii\base\InvalidConfigException |
||
123 | */ |
||
124 | public function getSettingsHtml() |
||
140 | |||
141 | /** |
||
142 | * @inheritdoc |
||
143 | * @throws \Twig_Error_Loader |
||
144 | * @throws \yii\base\Exception |
||
145 | */ |
||
146 | public function getInputHtml($value, ElementInterface $element = null): string |
||
157 | |||
158 | /** |
||
159 | * @inheritdoc |
||
160 | */ |
||
161 | public function serializeValue($value, ElementInterface $element = null) |
||
178 | |||
179 | /** |
||
180 | * @inheritdoc |
||
181 | * @throws \yii\base\InvalidConfigException |
||
182 | */ |
||
183 | public function getSettings(): array |
||
197 | |||
198 | /** |
||
199 | * @inheritdoc |
||
200 | */ |
||
201 | public function getElementValidationRules(): array |
||
209 | |||
210 | /** |
||
211 | * @param $value |
||
212 | * @param ElementInterface|null $element |
||
213 | * @return array|TypeInterface|mixed|object|null |
||
214 | * @throws \yii\base\InvalidConfigException |
||
215 | */ |
||
216 | public function normalizeValue($value, ElementInterface $element = null) |
||
256 | |||
257 | /** |
||
258 | * Create objects from all (remaining) configurations |
||
259 | * |
||
260 | * @throws \yii\base\InvalidConfigException |
||
261 | */ |
||
262 | private function resolveConfigs() |
||
269 | |||
270 | /** |
||
271 | * @param string $identifier |
||
272 | * @param array $config |
||
273 | * @return TypeInterface|null |
||
274 | * @throws \yii\base\InvalidConfigException |
||
275 | */ |
||
276 | private function resolveConfig(string $identifier, array $config) |
||
293 | |||
294 | /** |
||
295 | * @param $type |
||
296 | * @return array|object|null |
||
297 | * @throws \yii\base\InvalidConfigException |
||
298 | */ |
||
299 | private function createType($type) |
||
319 | |||
320 | /** |
||
321 | * @param string $identifier |
||
322 | * @return TypeInterface|null |
||
323 | * @throws \yii\base\InvalidConfigException |
||
324 | */ |
||
325 | private function createFromConfig(string $identifier) |
||
333 | } |
||
334 |