From 80105c857e69f4e320aa4589aee1ce0d3f02c07a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Kv=C3=A1=C4=8Dek?= Date: Sun, 25 Sep 2016 01:35:39 +0200 Subject: [PATCH] FEATURE: extend registering widgets by setting template and module ID --- app/Handlers/Registrators/WidgetRegistrator.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/Handlers/Registrators/WidgetRegistrator.php b/app/Handlers/Registrators/WidgetRegistrator.php index e70cf9ee..d3b68a3a 100644 --- a/app/Handlers/Registrators/WidgetRegistrator.php +++ b/app/Handlers/Registrators/WidgetRegistrator.php @@ -18,9 +18,11 @@ class WidgetRegistrator /** * Method used for registering new widgets * - * @param $classname + * @param $classname + * @param null $templateId + * @param null $moduleId */ - public function register($classname) + public function register($classname, $templateId = null, $moduleId = null) { $class = new $classname; if (!$class instanceof PublicWidget) { @@ -36,6 +38,8 @@ class WidgetRegistrator WidgetType::create([ 'handler' => $classname, 'name' => $widgetName, + 'module_id' => $moduleId, + 'template_id' => $templateId, 'description' => $widgetDescription ]);