refactor Event Listeners

This commit is contained in:
Eric Espie
2022-06-01 14:29:43 +02:00
parent 35e1f080b8
commit e77f21a0b5
9 changed files with 136 additions and 119 deletions

View File

@@ -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>