mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-24 02:58:43 +02:00
N°4756 - Ease extensibility for CRUD operations : Event Service - renamed service setup interface
This commit is contained in:
@@ -16,7 +16,7 @@ use utils;
|
||||
|
||||
class EventService
|
||||
{
|
||||
public static $aEventListeners = [];
|
||||
private static $aEventListeners = [];
|
||||
private static $iEventIdCounter = 0;
|
||||
private static $aEventDescription = [];
|
||||
|
||||
@@ -26,11 +26,11 @@ class EventService
|
||||
self::$iEventIdCounter = 0;
|
||||
self::$aEventDescription = [];
|
||||
|
||||
$aEventEnrolments = utils::GetClassesForInterface(iEventEnrolment::class);
|
||||
foreach ($aEventEnrolments as $sEventEnrolmentClass) {
|
||||
/** @var \Combodo\iTop\Service\iEventEnrolment $oEventEnrolment */
|
||||
$oEventEnrolment = new $sEventEnrolmentClass();
|
||||
$oEventEnrolment->InitEvents();
|
||||
$aEventServiceSetup = utils::GetClassesForInterface(iEventServiceSetup::class);
|
||||
foreach ($aEventServiceSetup as $sEventServiceSetupClass) {
|
||||
/** @var \Combodo\iTop\Service\iEventServiceSetup $oEventServiceSetup */
|
||||
$oEventServiceSetup = new $sEventServiceSetupClass();
|
||||
$oEventServiceSetup->RegisterEventsAndListeners();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,11 +6,16 @@
|
||||
|
||||
namespace Combodo\iTop\Service;
|
||||
|
||||
interface iEventEnrolment
|
||||
/**
|
||||
* Interface to implement in order to register the events and listeners
|
||||
*
|
||||
* @since 3.1.0
|
||||
*/
|
||||
interface iEventServiceSetup
|
||||
{
|
||||
/**
|
||||
* Extension point to register the events and events listeners
|
||||
* @return void
|
||||
*/
|
||||
public function InitEvents();
|
||||
public function RegisterEventsAndListeners();
|
||||
}
|
||||
Reference in New Issue
Block a user