-
Notifications
You must be signed in to change notification settings - Fork 148
Expand file tree
/
Copy pathIconFormOption.class.php
More file actions
58 lines (50 loc) · 1.54 KB
/
IconFormOption.class.php
File metadata and controls
58 lines (50 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php
namespace wcf\system\form\option;
use wcf\system\database\table\column\AbstractDatabaseTableColumn;
use wcf\system\database\table\column\VarcharDatabaseTableColumn;
use wcf\system\form\builder\field\AbstractFormField;
use wcf\system\form\builder\field\IconFormField;
use wcf\system\form\option\formatter\IconFormatter;
use wcf\system\form\option\formatter\IFormOptionFormatter;
/**
* Implementation of a form field for icon values.
*
* @author Marcel Werk
* @copyright 2001-2025 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @since 6.2
*/
class IconFormOption extends AbstractFormOption
{
#[\Override]
public function getId(): string
{
return 'icon';
}
#[\Override]
public function getFormField(string $id, array $configuration = []): AbstractFormField
{
return IconFormField::create($id);
}
#[\Override]
public function getFormatter(): IFormOptionFormatter
{
return new IconFormatter();
}
#[\Override]
public function getFilterFormField(string $id, array $configuration = []): AbstractFormField
{
throw new \BadMethodCallException("IconFormOption does not support filtering.");
}
#[\Override]
public function isFilterable(): bool
{
return false;
}
#[\Override]
public function getDatabaseTableColumn(string $name): AbstractDatabaseTableColumn
{
return VarcharDatabaseTableColumn::create($name)
->length(255);
}
}