1 | <?php |
||
27 | class Link extends Field |
||
28 | { |
||
29 | |||
30 | /** |
||
31 | * Type objects that have been configured via the admin |
||
32 | * |
||
33 | * @var TypeInterface[] |
||
34 | */ |
||
35 | protected $types = []; |
||
36 | |||
37 | /** |
||
38 | * Raw configurations that have been configured via the admin |
||
39 | * |
||
40 | * @var array |
||
41 | */ |
||
42 | protected $typeConfigs = []; |
||
43 | |||
44 | /** |
||
45 | * @return TypeInterface[] |
||
46 | * @throws \yii\base\InvalidConfigException |
||
47 | */ |
||
48 | public function getTypes() |
||
55 | |||
56 | /** |
||
57 | * @param array $types |
||
58 | * @return $this |
||
59 | */ |
||
60 | public function setTypes(array $types) |
||
68 | |||
69 | /** |
||
70 | * @param string $identifier |
||
71 | * @return TypeInterface|null |
||
72 | * @throws \yii\base\InvalidConfigException |
||
73 | */ |
||
74 | public function getType(string $identifier) |
||
88 | |||
89 | /** |
||
90 | * @inheritdoc |
||
91 | */ |
||
92 | public static function displayName(): string |
||
96 | |||
97 | /** |
||
98 | * @inheritdoc |
||
99 | */ |
||
100 | public function getContentColumnType(): string |
||
104 | |||
105 | /** |
||
106 | * @inheritdoc |
||
107 | * @throws \Twig_Error_Loader |
||
108 | * @throws \yii\base\Exception |
||
109 | * @throws \yii\base\InvalidConfigException |
||
110 | */ |
||
111 | public function getSettingsHtml() |
||
127 | |||
128 | /** |
||
129 | * @inheritdoc |
||
130 | * @throws \Twig_Error_Loader |
||
131 | * @throws \yii\base\Exception |
||
132 | */ |
||
133 | public function getInputHtml($value, ElementInterface $element = null): string |
||
144 | |||
145 | /** |
||
146 | * @inheritdoc |
||
147 | */ |
||
148 | public function serializeValue($value, ElementInterface $element = null) |
||
165 | |||
166 | /** |
||
167 | * @inheritdoc |
||
168 | * @throws \yii\base\InvalidConfigException |
||
169 | */ |
||
170 | public function getSettings(): array |
||
184 | |||
185 | /** |
||
186 | * @inheritdoc |
||
187 | */ |
||
188 | public function getElementValidationRules(): array |
||
196 | |||
197 | /** |
||
198 | * @param $value |
||
199 | * @param ElementInterface|null $element |
||
200 | * @return array|TypeInterface|mixed|object|null |
||
201 | * @throws \yii\base\InvalidConfigException |
||
202 | */ |
||
203 | public function normalizeValue($value, ElementInterface $element = null) |
||
243 | |||
244 | /** |
||
245 | * Create objects from all (remaining) configurations |
||
246 | * |
||
247 | * @throws \yii\base\InvalidConfigException |
||
248 | */ |
||
249 | private function resolveConfigs() |
||
256 | |||
257 | /** |
||
258 | * @param string $identifier |
||
259 | * @param array $config |
||
260 | * @return TypeInterface|null |
||
261 | * @throws \yii\base\InvalidConfigException |
||
262 | */ |
||
263 | private function resolveConfig(string $identifier, array $config) |
||
280 | |||
281 | /** |
||
282 | * @param $type |
||
283 | * @return array|object|null |
||
284 | * @throws \yii\base\InvalidConfigException |
||
285 | */ |
||
286 | private function createType($type) |
||
306 | |||
307 | /** |
||
308 | * @param string $identifier |
||
309 | * @return TypeInterface|null |
||
310 | * @throws \yii\base\InvalidConfigException |
||
311 | */ |
||
312 | private function createFromConfig(string $identifier) |
||
320 | } |
||
321 |