From 97c3cacfaaccbf4b235d4c7215be7a60e7788b53 Mon Sep 17 00:00:00 2001 From: Eric Espie Date: Mon, 2 Jan 2023 14:20:17 +0100 Subject: [PATCH] =?UTF-8?q?N=C2=B04756=20-=20Ease=20extensibility=20for=20?= =?UTF-8?q?CRUD=20operations=20:=20Pass=20DeletionPlan=20to=20EVENT=5FDB?= =?UTF-8?q?=5FCHECK=5FTO=5FDELETE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/cmdbabstract.class.inc.php | 8 ++++---- core/dbobject.class.php | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/application/cmdbabstract.class.inc.php b/application/cmdbabstract.class.inc.php index 91eba52e5e..739d0339b3 100644 --- a/application/cmdbabstract.class.inc.php +++ b/application/cmdbabstract.class.inc.php @@ -5754,9 +5754,9 @@ JS * @inheritDoc * @since 3.1.0 */ - final protected function EventUpdateDone(array $aData): void + final protected function EventUpdateDone(array $aChanges): void { - $this->FireEvent(EVENT_DB_UPDATE_DONE, $aData); + $this->FireEvent(EVENT_DB_UPDATE_DONE, ['changes' => $aChanges]); } ////////////// @@ -5767,9 +5767,9 @@ JS * @inheritDoc * @since 3.1.0 */ - final protected function EventCheckToDelete(): void + final protected function EventCheckToDelete(DeletionPlan $oDeletionPlan): void { - $this->FireEvent(EVENT_DB_CHECK_TO_DELETE); + $this->FireEvent(EVENT_DB_CHECK_TO_DELETE, ['deletion_plan' => $oDeletionPlan]); } /** diff --git a/core/dbobject.class.php b/core/dbobject.class.php index 5a953ca029..65658a8a22 100644 --- a/core/dbobject.class.php +++ b/core/dbobject.class.php @@ -3363,7 +3363,7 @@ abstract class DBObject implements iDisplay $this->m_aModifiedAtt = array(); try { - $this->EventUpdateDone(['changes' => $aChanges]); + $this->EventUpdateDone($aChanges); $this->AfterUpdate(); // Reset original values although the object has not been reloaded @@ -4861,7 +4861,7 @@ abstract class DBObject implements iDisplay } // Check the node itself $this->m_aDeleteIssues = array(); // Ok - $this->EventCheckToDelete(); + $this->EventCheckToDelete($oDeletionPlan); $this->DoCheckToDelete($oDeletionPlan); $oDeletionPlan->SetDeletionIssues($this, $this->m_aDeleteIssues, $this->m_bSecurityIssue); @@ -5987,7 +5987,7 @@ abstract class DBObject implements iDisplay * @return void * @since 3.1.0 */ - protected function EventUpdateDone(array $aData): void + protected function EventUpdateDone(array $aChanges): void { } @@ -5999,7 +5999,7 @@ abstract class DBObject implements iDisplay * @return void * @since 3.1.0 */ - protected function EventCheckToDelete(): void + protected function EventCheckToDelete(DeletionPlan $oDeletionPlan): void { }