N°4756 - Ease extensibility for CRUD operations : Coherency in method parameters

This commit is contained in:
Eric Espie
2023-01-02 14:23:36 +01:00
parent 97c3cacfaa
commit 4c4d7c12e8
2 changed files with 12 additions and 12 deletions

View File

@@ -5687,9 +5687,9 @@ JS
* @inheritDoc
* @since 3.1.0
*/
final protected function EventCheckToCreateFailed(array $aData): void
final protected function EventCheckToCreateFailed(array $aIssues): void
{
$this->FireEvent(EVENT_DB_CHECK_TO_CREATE_FAILED, $aData);
$this->FireEvent(EVENT_DB_CHECK_TO_CREATE_FAILED, ['check_issues' => $aIssues]);
}
/**
@@ -5736,9 +5736,9 @@ JS
* @inheritDoc
* @since 3.1.0
*/
final protected function EventCheckToUpdateFailed(array $aData): void
final protected function EventCheckToUpdateFailed(array $aIssues): void
{
$this->FireEvent(EVENT_DB_CHECK_TO_UPDATE_FAILED, $aData);
$this->FireEvent(EVENT_DB_CHECK_TO_UPDATE_FAILED, ['check_issues' => $aIssues]);
}
/**
@@ -5776,9 +5776,9 @@ JS
* @inheritDoc
* @since 3.1.0
*/
final protected function EventCheckToDeleteFailed(array $aData): void
final protected function EventCheckToDeleteFailed(array $aIssues): void
{
$this->FireEvent(EVENT_DB_CHECK_TO_DELETE_FAILED, $aData);
$this->FireEvent(EVENT_DB_CHECK_TO_DELETE_FAILED, ['check_issues' => $aIssues]);
}
/**

View File

@@ -2376,9 +2376,9 @@ abstract class DBObject implements iDisplay
{
$this->m_bCheckStatus = false;
if ($this->IsNew()) {
$this->EventCheckToCreateFailed(['check_issues' => $this->m_aCheckIssues]);
$this->EventCheckToCreateFailed($this->m_aCheckIssues);
} else {
$this->EventCheckToUpdateFailed(['check_issues' => $this->m_aCheckIssues]);
$this->EventCheckToUpdateFailed($this->m_aCheckIssues);
}
}
}
@@ -3772,7 +3772,7 @@ abstract class DBObject implements iDisplay
if ($oDeletionPlan->FoundStopper())
{
$aIssues = $oDeletionPlan->GetIssues();
$this->EventCheckToDeleteFailed(['check_issues' => $aIssues]);
$this->EventCheckToDeleteFailed($aIssues);
throw new DeleteException('Found issue(s)', array('target_class' => get_class($this), 'target_id' => $this->GetKey(), 'issues' => implode(', ', $aIssues)));
}
@@ -5927,7 +5927,7 @@ abstract class DBObject implements iDisplay
* @return void
* @since 3.1.0
*/
protected function EventCheckToCreateFailed(array $aData): void
protected function EventCheckToCreateFailed(array $aIssues): void
{
}
@@ -5971,7 +5971,7 @@ abstract class DBObject implements iDisplay
* @return void
* @since 3.1.0
*/
protected function EventCheckToUpdateFailed(array $aData): void
protected function EventCheckToUpdateFailed(array $aIssues): void
{
}
@@ -6007,7 +6007,7 @@ abstract class DBObject implements iDisplay
* @return void
* @since 3.1.0
*/
protected function EventCheckToDeleteFailed(array $aData): void
protected function EventCheckToDeleteFailed(array $aIssues): void
{
}