This commit is contained in:
2026-02-17 14:56:23 +01:00
commit 68f7a95fdf
695 changed files with 154611 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
<?php
namespace DynCom\mysyde\common\traits;
use DynCom\mysyde\common\classes\Hook;
/**
* Created by PhpStorm.
* User: Bauer
* Date: 15.07.2015
* Time: 11:20
*/
trait hookableTrait
{
/**
* @param $eventName
* @param $data
*/
protected function updateHooks($eventName, $data)
{
$parents = class_parents($this);
$interfaces = class_implements($this);
$className = get_class($this);
$notificationTargets = [$className];
$namespace = '';
foreach ($parents as $parent) {
$notificationTargets[] = $parent;
}
foreach ($interfaces as $interface) {
$notificationTargets[] = $interface;
}
foreach ($notificationTargets as $target) {
Hook::update($eventName, $data, $target);
}
Hook::update($eventName, $data);
}
}