Add EVENT_DB_BEFORE_CREATE and EVENT_DB_BEFORE_UPDATE events in CRUD calls

This commit is contained in:
Eric Espie
2023-05-16 15:52:02 +02:00
parent 59cd489e72
commit ad25d8823f
4 changed files with 74 additions and 1 deletions

View File

@@ -340,7 +340,7 @@ final class EventService
foreach (self::$aEventDescriptions as $sEvent => $aEventInfo) {
if (is_array($aEventInfo['description']->GetEventSources())) {
foreach ($aEventInfo['description']->GetEventSources() as $sSource) {
if (\MetaModel::IsValidClass($sSource) && ($sClass == $sSource || $oClass->isSubclassOf($sSource))) {
if (class_exists($sSource) && ($sClass == $sSource || $oClass->isSubclassOf($sSource))) {
$aRes[$sEvent] = $aEventInfo;
}
}