getOption('collections.core_path', null, $modx->getOption('core_path', null, MODX_CORE_PATH) . 'components/collections/'); /** @var Collections $collections */ $collections = $modx->getService( 'collections', 'Collections', $corePath . 'model/collections/', array( 'core_path' => $corePath ) ); if (!($collections instanceof Collections)) return ''; $className = "\\Collections\\Events\\{$modx->event->name}"; if (class_exists($className)) { /** @var \Collections\Events\Event $handler */ $handler = new $className($modx, $scriptProperties); $handler->run(); } return;