From 2eecb495a4061a72f8fbb58777ad505844c59289 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Wed, 19 Sep 2018 21:34:04 +0200 Subject: [PATCH] Split controllers per application --- Admin/Routes/Web/Backend.php | 18 ++-- .../BackendController.php | 53 +----------- Controller/Controller.php | 85 +++++++++++++++++++ 3 files changed, 96 insertions(+), 60 deletions(-) rename Controller.php => Controller/BackendController.php (76%) create mode 100644 Controller/Controller.php diff --git a/Admin/Routes/Web/Backend.php b/Admin/Routes/Web/Backend.php index 5d7dbcb..3c461b4 100644 --- a/Admin/Routes/Web/Backend.php +++ b/Admin/Routes/Web/Backend.php @@ -3,15 +3,15 @@ use phpOMS\Router\RouteVerb; use phpOMS\Account\PermissionType; use Modules\Billing\Models\PermissionState; -use Modules\Billing\Controller; +use Modules\Billing\Controller\BackendController; return [ '^.*/backend/sales/invoice/create.*$' => [ [ - 'dest' => '\Modules\Billing\Controller:viewBillingInvoiceCreate', + 'dest' => '\Modules\Billing\Controller\BackendController:viewBillingInvoiceCreate', 'verb' => RouteVerb::GET, 'permission' => [ - 'module' => Controller::MODULE_NAME, + 'module' => BackendController::MODULE_NAME, 'type' => PermissionType::CREATE, 'state' => PermissionState::SALES_INVOICE, ], @@ -19,10 +19,10 @@ return [ ], '^.*/backend/sales/invoice/list.*$' => [ [ - 'dest' => '\Modules\Billing\Controller:viewBillingInvoiceList', + 'dest' => '\Modules\Billing\Controller\BackendController:viewBillingInvoiceList', 'verb' => RouteVerb::GET, 'permission' => [ - 'module' => Controller::MODULE_NAME, + 'module' => BackendController::MODULE_NAME, 'type' => PermissionType::READ, 'state' => PermissionState::SALES_INVOICE, ], @@ -30,10 +30,10 @@ return [ ], '^.*/backend/purchase/invoice/create.*$' => [ [ - 'dest' => '\Modules\Billing\Controller:viewBillingPurchaseInvoiceCreate', + 'dest' => '\Modules\Billing\Controller\BackendController:viewBillingPurchaseInvoiceCreate', 'verb' => RouteVerb::GET, 'permission' => [ - 'module' => Controller::MODULE_NAME, + 'module' => BackendController::MODULE_NAME, 'type' => PermissionType::CREATE, 'state' => PermissionState::PURCHASE_INVOICE, ], @@ -41,10 +41,10 @@ return [ ], '^.*/backend/purchase/invoice/list.*$' => [ [ - 'dest' => '\Modules\Billing\Controller:viewBillingPurchaInvoiceList', + 'dest' => '\Modules\Billing\Controller\BackendController:viewBillingPurchaInvoiceList', 'verb' => RouteVerb::GET, 'permission' => [ - 'module' => Controller::MODULE_NAME, + 'module' => BackendController::MODULE_NAME, 'type' => PermissionType::READ, 'state' => PermissionState::PURCHASE_INVOICE, ], diff --git a/Controller.php b/Controller/BackendController.php similarity index 76% rename from Controller.php rename to Controller/BackendController.php index ee1a3e5..b7b8244 100644 --- a/Controller.php +++ b/Controller/BackendController.php @@ -12,7 +12,7 @@ */ declare(strict_types=1); -namespace Modules\Billing; +namespace Modules\Billing\Controller; use Modules\Navigation\Models\Navigation; use Modules\Navigation\Views\NavigationView; @@ -31,58 +31,9 @@ use phpOMS\Views\View; * @link http://website.orange-management.de * @since 1.0.0 */ -final class Controller extends ModuleAbstract implements WebInterface +class BackendController extends Controller { - /** - * Module path. - * - * @var string - * @since 1.0.0 - */ - public const MODULE_PATH = __DIR__; - - /** - * Module version. - * - * @var string - * @since 1.0.0 - */ - public const MODULE_VERSION = '1.0.0'; - - /** - * Module name. - * - * @var string - * @since 1.0.0 - */ - public const MODULE_NAME = 'Billing'; - - /** - * Module id. - * - * @var int - * @since 1.0.0 - */ - public const MODULE_ID = 1005100000; - - /** - * Providing. - * - * @var string[] - * @since 1.0.0 - */ - protected static $providing = []; - - /** - * Dependencies. - * - * @var string[] - * @since 1.0.0 - */ - protected static $dependencies = [ - ]; - /** * @param RequestAbstract $request Request * @param ResponseAbstract $response Response diff --git a/Controller/Controller.php b/Controller/Controller.php new file mode 100644 index 0000000..8878f7a --- /dev/null +++ b/Controller/Controller.php @@ -0,0 +1,85 @@ +