AlbumFactory.php
2 days ago
AlternateTextFactory.php
2 days ago
ArtistFactory.php
2 days ago
AudioPlayerFactory.php
2 days ago
AvailableSizesFactory.php
2 days ago
CaptionFactory.php
2 days ago
DimensionsFactory.php
2 days ago
DownloadFactory.php
2 days ago
ExifDataFactory.php
2 days ago
FileMetaAudioFactory.php
2 days ago
FileMetaVideoFactory.php
2 days ago
FileNameFactory.php
2 days ago
FileSizeFactory.php
2 days ago
FullPathFactory.php
2 days ago
HeightFactory.php
2 days ago
ImageFactory.php
2 days ago
MimeTypeFactory.php
2 days ago
PreviewFactory.php
2 days ago
VideoPlayerFactory.php
2 days ago
WidthFactory.php
2 days ago
ImageFactory.php
49 lines
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace AC\ColumnFactory\Media; |
| 6 | |
| 7 | use AC\Column\BaseColumnFactory; |
| 8 | use AC\Setting\ComponentCollection; |
| 9 | use AC\Setting\ComponentFactory\ImageSize; |
| 10 | use AC\Setting\Config; |
| 11 | use AC\Setting\DefaultSettingsBuilder; |
| 12 | |
| 13 | class ImageFactory extends BaseColumnFactory |
| 14 | { |
| 15 | private ImageSize $image_size; |
| 16 | |
| 17 | public function __construct( |
| 18 | DefaultSettingsBuilder $default_settings_builder, |
| 19 | ImageSize $image_size |
| 20 | ) { |
| 21 | parent::__construct($default_settings_builder); |
| 22 | |
| 23 | $this->image_size = $image_size; |
| 24 | } |
| 25 | |
| 26 | protected function get_settings(Config $config): ComponentCollection |
| 27 | { |
| 28 | return new ComponentCollection([ |
| 29 | $this->image_size->create($config), |
| 30 | ]); |
| 31 | } |
| 32 | |
| 33 | public function get_column_type(): string |
| 34 | { |
| 35 | return 'column-image'; |
| 36 | } |
| 37 | |
| 38 | public function get_label(): string |
| 39 | { |
| 40 | return __('Image', 'codepress-admin-columns'); |
| 41 | } |
| 42 | |
| 43 | protected function get_group(): ?string |
| 44 | { |
| 45 | return 'media-image'; |
| 46 | } |
| 47 | |
| 48 | } |
| 49 |