N°4756 - Ease extensibility for CRUD operations : Pass DeletionPlan to EVENT_DB_CHECK_TO_DELETE

This commit is contained in:
Eric Espie
2023-01-02 14:20:17 +01:00
parent 98ec568788
commit 97c3cacfaa
2 changed files with 8 additions and 8 deletions

View File

@@ -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]);
}
/**

View File

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