diff --git a/src/QUI/Menu/Independent/Factory.php b/src/QUI/Menu/Independent/Factory.php index 3e717a40d7748aa43f4431faa306dcfb45223207..fdf594c7c6bfd5dff0329373c7589d730fe450c9 100644 --- a/src/QUI/Menu/Independent/Factory.php +++ b/src/QUI/Menu/Independent/Factory.php @@ -25,7 +25,15 @@ public static function createMenu(): Menu $lastId = QUI::getPDO()->lastInsertId(); - return Handler::getMenu($lastId); + $Menu = Handler::getMenu($lastId); + + try { + QUI::getEvents()->fireEvent('quiqqerMenuIndependentCreate', [$Menu]); + } catch (\Exception $Exception) { + QUI\System\Log::writeException($Exception); + } + + return $Menu; } /** diff --git a/src/QUI/Menu/Independent/Menu.php b/src/QUI/Menu/Independent/Menu.php index f5a7328a1db7536dca41ddd37b83f519fa37e4d4..69883e052d053bb8d9bc5ecfbf65567100492367 100644 --- a/src/QUI/Menu/Independent/Menu.php +++ b/src/QUI/Menu/Independent/Menu.php @@ -20,12 +20,12 @@ */ class Menu { - protected int $id; - protected ?array $title = null; - protected ?array $workingTitle = null; - protected array $data = []; - protected array $children = []; - protected int $currentChildId = 0; + protected int $id; + protected ?array $title = null; + protected ?array $workingTitle = null; + protected array $data = []; + protected array $children = []; + protected int $currentChildId = 0; /** * @param int|array $menuId - menu id or menu data @@ -254,6 +254,12 @@ public function save(?QUI\Interfaces\Users\User $PermissionUser = null) ], [ 'id' => $this->getId() ]); + + try { + QUI::getEvents()->fireEvent('quiqqerMenuIndependentSave', [$this]); + } catch (\Exception $Exception) { + QUI\System\Log::writeException($Exception); + } } /**