mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-18 14:58:43 +02:00
N°4756 - Ease extensibility for CRUD operations : Event Service - Moved Events source code under sources/application/events
This commit is contained in:
@@ -6,9 +6,9 @@
|
||||
|
||||
namespace Combodo\iTop\Application;
|
||||
|
||||
use Combodo\iTop\Service\Description\EventDescription;
|
||||
use Combodo\iTop\Service\EventService;
|
||||
use Combodo\iTop\Service\iEventServiceSetup;
|
||||
use Combodo\iTop\Service\Events\Description\EventDescription;
|
||||
use Combodo\iTop\Service\Events\EventService;
|
||||
use Combodo\iTop\Service\Events\iEventServiceSetup;
|
||||
|
||||
class ApplicationEvents implements iEventServiceSetup
|
||||
{
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* @license http://opensource.org/licenses/AGPL-3.0
|
||||
*/
|
||||
|
||||
namespace Combodo\iTop\Service\Description;
|
||||
namespace Combodo\iTop\Service\Events\Description;
|
||||
|
||||
/**
|
||||
* Description of the data given with an event when registering
|
||||
@@ -4,7 +4,7 @@
|
||||
* @license http://opensource.org/licenses/AGPL-3.0
|
||||
*/
|
||||
|
||||
namespace Combodo\iTop\Service\Description;
|
||||
namespace Combodo\iTop\Service\Events\Description;
|
||||
|
||||
/**
|
||||
* Description of an event when registering
|
||||
@@ -20,7 +20,7 @@ class EventDescription
|
||||
private $mEventSources;
|
||||
private string $sDescription;
|
||||
private string $sReplaces;
|
||||
/** @var \Combodo\iTop\Service\Description\EventDataDescription[] */
|
||||
/** @var \Combodo\iTop\Service\Events\Description\EventDataDescription[] */
|
||||
private array $aEventDataDescription;
|
||||
private string $sModule;
|
||||
|
||||
@@ -32,7 +32,7 @@ class EventDescription
|
||||
* @param string|string[]|null $mEventSources Source(s) for this event (can be the root class for CRUD events)
|
||||
* @param string $sDescription Description of the event
|
||||
* @param string $sReplaces In case this event obsoletes previous extensibility functions
|
||||
* @param \Combodo\iTop\Service\Description\EventDataDescription[] $aEventDataDescription Description of the data associated with this event
|
||||
* @param \Combodo\iTop\Service\Events\Description\EventDataDescription[] $aEventDataDescription Description of the data associated with this event
|
||||
* @param string $sModule iTop Module name where the event is defined
|
||||
*/
|
||||
public function __construct(string $sEventName, $mEventSources, string $sDescription, string $sReplaces, array $aEventDataDescription, string $sModule)
|
||||
@@ -102,7 +102,7 @@ class EventDescription
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \Combodo\iTop\Service\Description\EventDataDescription[]s $aEventDataDescription
|
||||
* @param \Combodo\iTop\Service\Events\Description\EventDataDescription[]s $aEventDataDescription
|
||||
*/
|
||||
public function SetEventDataDescription(array $aEventDataDescription): void
|
||||
{
|
||||
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (C) 2010-2020 Combodo SARL
|
||||
/*
|
||||
* @copyright Copyright (C) 2010-2022 Combodo SARL
|
||||
* @license http://opensource.org/licenses/AGPL-3.0
|
||||
*/
|
||||
|
||||
namespace Combodo\iTop\Service;
|
||||
namespace Combodo\iTop\Service\Events;
|
||||
|
||||
|
||||
/**
|
||||
@@ -4,7 +4,7 @@
|
||||
* @license http://opensource.org/licenses/AGPL-3.0
|
||||
*/
|
||||
|
||||
namespace Combodo\iTop\Service;
|
||||
namespace Combodo\iTop\Service\Events;
|
||||
|
||||
use IssueLog;
|
||||
use LogChannels;
|
||||
@@ -1,13 +1,13 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (C) 2010-2020 Combodo SARL
|
||||
/*
|
||||
* @copyright Copyright (C) 2010-2022 Combodo SARL
|
||||
* @license http://opensource.org/licenses/AGPL-3.0
|
||||
*/
|
||||
|
||||
namespace Combodo\iTop\Service;
|
||||
namespace Combodo\iTop\Service\Events;
|
||||
|
||||
use Closure;
|
||||
use Combodo\iTop\Service\Description\EventDescription;
|
||||
use Combodo\iTop\Service\Events\Description\EventDescription;
|
||||
use ContextTag;
|
||||
use CoreException;
|
||||
use Exception;
|
||||
@@ -44,7 +44,7 @@ class EventService
|
||||
|
||||
$aEventServiceSetup = utils::GetClassesForInterface(iEventServiceSetup::class, '', ['[\\\\/]lib[\\\\/]', '[\\\\/]node_modules[\\\\/]', '[\\\\/]test[\\\\/]']);
|
||||
foreach ($aEventServiceSetup as $sEventServiceSetupClass) {
|
||||
/** @var \Combodo\iTop\Service\iEventServiceSetup $oEventServiceSetup */
|
||||
/** @var \Combodo\iTop\Service\Events\iEventServiceSetup $oEventServiceSetup */
|
||||
$oEventServiceSetup = new $sEventServiceSetupClass();
|
||||
$oEventServiceSetup->RegisterEventsAndListeners();
|
||||
}
|
||||
@@ -114,7 +114,7 @@ class EventService
|
||||
* Fire an event. Call all the callbacks registered for this event.
|
||||
*
|
||||
* @api
|
||||
* @param \Combodo\iTop\Service\EventData $oEventData
|
||||
* @param \Combodo\iTop\Service\Events\EventData $oEventData
|
||||
*
|
||||
* @throws \Exception from the callback
|
||||
*/
|
||||
@@ -282,7 +282,7 @@ class EventService
|
||||
* This step is mandatory before firing an event.
|
||||
*
|
||||
* @api
|
||||
* @param \Combodo\iTop\Service\Description\EventDescription $oEventDescription
|
||||
* @param \Combodo\iTop\Service\Events\Description\EventDescription $oEventDescription
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
@@ -4,7 +4,7 @@
|
||||
* @license http://opensource.org/licenses/AGPL-3.0
|
||||
*/
|
||||
|
||||
namespace Combodo\iTop\Service;
|
||||
namespace Combodo\iTop\Service\Events;
|
||||
|
||||
/**
|
||||
* Interface to implement in order to register the events and listeners
|
||||
Reference in New Issue
Block a user