Addons.php
46 lines
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace AC\Admin\PageFactory; |
| 6 | |
| 7 | use AC\Admin\MenuFactoryInterface; |
| 8 | use AC\Admin\Page; |
| 9 | use AC\Admin\PageFactoryInterface; |
| 10 | use AC\Admin\View; |
| 11 | use AC\AdminColumns; |
| 12 | use AC\Integration\IntegrationRepository; |
| 13 | |
| 14 | class Addons implements PageFactoryInterface |
| 15 | { |
| 16 | protected AdminColumns $plugin; |
| 17 | |
| 18 | protected IntegrationRepository $integrations; |
| 19 | |
| 20 | protected MenuFactoryInterface $menu_factory; |
| 21 | |
| 22 | protected View\MenuFactory $view_menu_factory; |
| 23 | |
| 24 | public function __construct( |
| 25 | AdminColumns $plugin, |
| 26 | IntegrationRepository $integrations, |
| 27 | MenuFactoryInterface $menu_factory, |
| 28 | View\MenuFactory $view_menu_factory |
| 29 | ) { |
| 30 | $this->plugin = $plugin; |
| 31 | $this->integrations = $integrations; |
| 32 | $this->menu_factory = $menu_factory; |
| 33 | $this->view_menu_factory = $view_menu_factory; |
| 34 | } |
| 35 | |
| 36 | public function create(): Page\Addons |
| 37 | { |
| 38 | return new Page\Addons( |
| 39 | $this->plugin, |
| 40 | $this->integrations, |
| 41 | $this->view_menu_factory->create($this->menu_factory, 'addons') |
| 42 | ); |
| 43 | } |
| 44 | |
| 45 | } |
| 46 |