Base.php
1 day ago
BaseColumnFactory.php
1 day ago
ColumnFactory.php
1 day ago
ColumnIdGenerator.php
1 day ago
ColumnLabelTrait.php
1 day ago
Context.php
1 day ago
CustomFieldContext.php
1 day ago
GroupTrait.php
1 day ago
LabelEncoder.php
1 day ago
SettingUpdater.php
1 day ago
Context.php
58 lines
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace AC\Column; |
| 6 | |
| 7 | use AC; |
| 8 | use AC\Setting\Config; |
| 9 | |
| 10 | class Context implements AC\Setting\Context |
| 11 | { |
| 12 | protected Config $config; |
| 13 | |
| 14 | private string $type_label; |
| 15 | |
| 16 | public function __construct(Config $config, string $type_label) |
| 17 | { |
| 18 | $this->config = $config; |
| 19 | $this->type_label = $type_label; |
| 20 | } |
| 21 | |
| 22 | public function get_type(): string |
| 23 | { |
| 24 | return $this->get('type'); |
| 25 | } |
| 26 | |
| 27 | public function get_name(): string |
| 28 | { |
| 29 | return $this->get('name', ''); |
| 30 | } |
| 31 | |
| 32 | public function get_label(): string |
| 33 | { |
| 34 | return $this->get('label', ''); |
| 35 | } |
| 36 | |
| 37 | public function get_type_label(): string |
| 38 | { |
| 39 | return $this->type_label; |
| 40 | } |
| 41 | |
| 42 | public function has(string $key): bool |
| 43 | { |
| 44 | return $this->config->has($key); |
| 45 | } |
| 46 | |
| 47 | public function get(string $key, $default = null) |
| 48 | { |
| 49 | return $this->config->get($key, $default); |
| 50 | } |
| 51 | |
| 52 | public function all(): array |
| 53 | { |
| 54 | return $this->config->all(); |
| 55 | } |
| 56 | |
| 57 | } |
| 58 |