Base.php
3 months ago
BaseColumnFactory.php
3 months ago
ColumnFactory.php
3 months ago
ColumnIdGenerator.php
3 months ago
ColumnLabelTrait.php
3 months ago
Context.php
3 months ago
CustomFieldContext.php
3 months ago
GroupTrait.php
3 months ago
LabelEncoder.php
3 months ago
SettingUpdater.php
3 months ago
BaseColumnFactory.php
41 lines
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace AC\Column; |
| 6 | |
| 7 | use AC\Column; |
| 8 | use AC\Setting\Config; |
| 9 | use AC\Setting\DefaultSettingsBuilder; |
| 10 | |
| 11 | abstract class BaseColumnFactory extends ColumnFactory |
| 12 | { |
| 13 | |
| 14 | use GroupTrait; |
| 15 | |
| 16 | private DefaultSettingsBuilder $default_settings_builder; |
| 17 | |
| 18 | public function __construct(DefaultSettingsBuilder $default_settings_builder) |
| 19 | { |
| 20 | $this->default_settings_builder = $default_settings_builder; |
| 21 | } |
| 22 | |
| 23 | public function create(Config $config): Column |
| 24 | { |
| 25 | $column_id_generator = new ColumnIdGenerator(); |
| 26 | |
| 27 | return new Base( |
| 28 | $this->get_column_type(), |
| 29 | $this->get_label(), |
| 30 | $this->default_settings_builder |
| 31 | ->build($config) |
| 32 | ->merge($this->get_settings($config)), |
| 33 | $column_id_generator->from_config($config), |
| 34 | $this->get_context($config), |
| 35 | $this->get_formatters($config), |
| 36 | $this->get_group(), |
| 37 | $this->get_description() |
| 38 | ); |
| 39 | } |
| 40 | |
| 41 | } |