mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-20 07:42:17 +02:00
refactor Event Listeners
This commit is contained in:
@@ -214,19 +214,24 @@
|
||||
<count_max>0</count_max>
|
||||
</field>
|
||||
</fields>
|
||||
<methods>
|
||||
<method id="DBInsertNoReload">
|
||||
<event_listeners>
|
||||
<listener id="OnTicketInsertRequested">
|
||||
<event>EVENT_SERVICE_DB_INSERT_REQUESTED</event>
|
||||
<callback>OnTicketInsertRequested</callback>
|
||||
<priority>-10</priority>
|
||||
</listener>
|
||||
</event_listeners>
|
||||
<methods>
|
||||
<method id="OnTicketInsertRequested">
|
||||
<static>false</static>
|
||||
<access>public</access>
|
||||
<type>Overload-DBObject</type>
|
||||
<type>Overload-ExNihilo</type>
|
||||
<code><![CDATA[
|
||||
public function DBInsertNoReload()
|
||||
public function OnTicketInsertRequested(Combodo\iTop\Service\EventData $oEventData)
|
||||
{
|
||||
$iNextId = ItopCounter::IncClass(get_class($this));
|
||||
$sRef = $this->MakeTicketRef($iNextId);
|
||||
$this->SetIfNull('ref', $sRef);
|
||||
$iKey = parent::DBInsertNoReload();
|
||||
return $iKey;
|
||||
}
|
||||
]]></code>
|
||||
</method>
|
||||
|
||||
Reference in New Issue
Block a user