From a693c343e8978dbeb31b606b5568a689e2998820 Mon Sep 17 00:00:00 2001 From: Eric Espie Date: Wed, 4 Jan 2023 14:18:01 +0100 Subject: [PATCH] =?UTF-8?q?N=C2=B04756=20-=20Ease=20extensibility=20for=20?= =?UTF-8?q?CRUD=20operations=20:=20Reduce=20events=20after=20review?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/cmdbabstract.class.inc.php | 18 ------------- application/datamodel.application.xml | 37 -------------------------- core/dbobject.class.php | 20 +------------- 3 files changed, 1 insertion(+), 74 deletions(-) diff --git a/application/cmdbabstract.class.inc.php b/application/cmdbabstract.class.inc.php index 3726c0248..1c40f90c0 100644 --- a/application/cmdbabstract.class.inc.php +++ b/application/cmdbabstract.class.inc.php @@ -5674,15 +5674,6 @@ JS $this->FireEvent(EVENT_DB_CHECK_TO_WRITE); } - /** - * @inheritDoc - * @since 3.1.0 - */ - final protected function EventCheckToWriteFailed(array $aIssues): void - { - $this->FireEvent(EVENT_DB_CHECK_TO_WRITE_FAILED, ['check_issues' => $aIssues]); - } - /** * @inheritDoc * @since 3.1.0 @@ -5718,15 +5709,6 @@ JS $this->FireEvent(EVENT_DB_CHECK_TO_DELETE, ['deletion_plan' => $oDeletionPlan]); } - /** - * @inheritDoc - * @since 3.1.0 - */ - final protected function EventCheckToDeleteFailed(array $aIssues): void - { - $this->FireEvent(EVENT_DB_CHECK_TO_DELETE_FAILED, ['check_issues' => $aIssues]); - } - /** * @inheritDoc * @since 3.1.0 diff --git a/application/datamodel.application.xml b/application/datamodel.application.xml index 9f89d7563..1f6e2d9fa 100644 --- a/application/datamodel.application.xml +++ b/application/datamodel.application.xml @@ -203,22 +203,6 @@ - - A check has failed, it is not possible to write the object in DB - - cmdbAbstractObject - - - - The object to check - DBObject - - - Debug string - string - - - An object has been created into the database. The modifications can be propagated to other objects. @@ -270,27 +254,6 @@ - - A check has failed, it is not possible to delete the object - - cmdbAbstractObject - - cmdbAbstractObject::DoCheckToWrite - - - Array of the issues (string) that prevented the object deletion - array - - - The object to check - DBObject - - - Debug string - string - - - An object has been deleted into the database diff --git a/core/dbobject.class.php b/core/dbobject.class.php index 7edc82d23..04952a69c 100644 --- a/core/dbobject.class.php +++ b/core/dbobject.class.php @@ -2373,7 +2373,6 @@ abstract class DBObject implements iDisplay else { $this->m_bCheckStatus = false; - $this->EventCheckToWriteFailed($this->m_aCheckIssues); } } return array($this->m_bCheckStatus, $this->m_aCheckIssues, $this->m_bSecurityIssue); @@ -3756,8 +3755,7 @@ abstract class DBObject implements iDisplay if ($oDeletionPlan->FoundStopper()) { $aIssues = $oDeletionPlan->GetIssues(); - $this->EventCheckToDeleteFailed($aIssues); - throw new DeleteException('Found issue(s)', array('target_class' => get_class($this), 'target_id' => $this->GetKey(), 'issues' => implode(', ', $aIssues))); + throw new DeleteException('Found issue(s)', array('target_class' => get_class($this), 'target_id' => $this->GetKey(), 'issues' => implode(', ', $aIssues))); } @@ -5899,14 +5897,6 @@ abstract class DBObject implements iDisplay { } - /** - * @return void - * @since 3.1.0 - */ - protected function EventCheckToWriteFailed(array $aIssues): void - { - } - /** * @return void * @since 3.1.0 @@ -5939,14 +5929,6 @@ abstract class DBObject implements iDisplay { } - /** - * @return void - * @since 3.1.0 - */ - protected function EventCheckToDeleteFailed(array $aIssues): void - { - } - /** * @return void * @since 3.1.0