mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 18:48:51 +02:00
Add EVENT_DB_BEFORE_CREATE and EVENT_DB_BEFORE_UPDATE events in CRUD calls
This commit is contained in:
@@ -3086,6 +3086,8 @@ abstract class DBObject implements iDisplay
|
||||
|
||||
$this->ComputeStopWatchesDeadline(true);
|
||||
|
||||
$this->FireEventBeforeDatabaseCreate();
|
||||
|
||||
$iTransactionRetry = 1;
|
||||
$bIsTransactionEnabled = MetaModel::GetConfig()->Get('db_core_transactions_enabled');
|
||||
if ($bIsTransactionEnabled) {
|
||||
@@ -3276,6 +3278,8 @@ abstract class DBObject implements iDisplay
|
||||
$this->ComputeStopWatchesDeadline(false);
|
||||
$this->OnUpdate();
|
||||
|
||||
$this->FireEventBeforeDatabaseUpdate();
|
||||
|
||||
// Freeze the changes at this point
|
||||
$this->InitPreviousValuesForUpdatedAttributes();
|
||||
$aChanges = $this->ListChanges();
|
||||
@@ -6053,6 +6057,14 @@ abstract class DBObject implements iDisplay
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
* @since 3.1.0
|
||||
*/
|
||||
protected function FireEventBeforeDatabaseCreate()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
* @since 3.1.0
|
||||
@@ -6069,6 +6081,16 @@ abstract class DBObject implements iDisplay
|
||||
* @return void
|
||||
* @since 3.1.0
|
||||
*/
|
||||
protected function FireEventBeforeDatabaseUpdate()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $aChanges
|
||||
*
|
||||
* @return void
|
||||
* @since 3.1.0
|
||||
*/
|
||||
protected function FireEventUpdateDone(array $aChanges): void
|
||||
{
|
||||
}
|
||||
@@ -6078,6 +6100,8 @@ abstract class DBObject implements iDisplay
|
||||
///
|
||||
|
||||
/**
|
||||
* @param \DeletionPlan $oDeletionPlan
|
||||
*
|
||||
* @return void
|
||||
* @since 3.1.0
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user