ScreenColumnsFactory.php
31 lines
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace AC\Table\SaveHeading; |
| 6 | |
| 7 | use AC\Registerable; |
| 8 | use AC\Storage\Repository\OriginalColumnsRepository; |
| 9 | use AC\Table\SaveHeadingFactory; |
| 10 | use AC\TableScreen; |
| 11 | |
| 12 | abstract class ScreenColumnsFactory implements SaveHeadingFactory |
| 13 | { |
| 14 | private OriginalColumnsRepository $repository; |
| 15 | |
| 16 | public function __construct(OriginalColumnsRepository $repository) |
| 17 | { |
| 18 | $this->repository = $repository; |
| 19 | } |
| 20 | |
| 21 | public function create(TableScreen $table_screen): ?Registerable |
| 22 | { |
| 23 | return new TableScreen\SaveHeading\ScreenColumns( |
| 24 | $table_screen->get_screen_id(), |
| 25 | $table_screen->get_id(), |
| 26 | $this->repository |
| 27 | ); |
| 28 | } |
| 29 | |
| 30 | } |
| 31 |