diff --git a/application/cmdbabstract.class.inc.php b/application/cmdbabstract.class.inc.php index 8c8b54357..f4a609e55 100644 --- a/application/cmdbabstract.class.inc.php +++ b/application/cmdbabstract.class.inc.php @@ -5661,31 +5661,160 @@ JS ); } + ////////////////// + /// CREATE + /// + /** * @inheritDoc - * @throws \CoreException + * @since 3.1.0 */ - final protected function EventInsertRequested(): void + final protected function EventCreateComputeValues(): void { - $this->FireEvent(EVENT_SERVICE_DB_INSERT_REQUESTED); + $this->FireEvent(EVENT_DB_CREATE_COMPUTE_VALUES); } /** * @inheritDoc - * @throws \CoreException + * @since 3.1.0 */ - final protected function EventInsertBefore(): void + final protected function EventCreateRequested(): void { - $this->FireEvent(EVENT_SERVICE_DB_ABOUT_TO_INSERT); + $this->FireEvent(EVENT_DB_CREATE_REQUESTED); } /** * @inheritDoc - * @throws \CoreException + * @since 3.1.0 */ - final protected function EventInsertAfter(): void + final protected function EventCheckToCreate(): void { - $this->FireEvent(EVENT_SERVICE_DB_INSERT_DONE); + $this->FireEvent(EVENT_DB_CHECK_TO_CREATE); + } + + /** + * @inheritDoc + * @since 3.1.0 + */ + final protected function EventCheckToCreateFailed(array $aData): void + { + $this->FireEvent(EVENT_DB_CHECK_TO_CREATE_FAILED, $aData); + } + + /** + * @inheritDoc + * @since 3.1.0 + */ + final protected function EventAboutToCreate(): void + { + $this->FireEvent(EVENT_DB_ABOUT_TO_CREATE); + } + + /** + * @inheritDoc + * @since 3.1.0 + */ + final protected function EventCreateDone(): void + { + $this->FireEvent(EVENT_DB_CREATE_DONE); + } + + ///////////// + /// UPDATE + /// + + /** + * @inheritDoc + * @since 3.1.0 + */ + final protected function EventUpdateComputeValues(): void + { + $this->FireEvent(EVENT_DB_UPDATE_COMPUTE_VALUES); + } + + /** + * @inheritDoc + * @since 3.1.0 + */ + final protected function EventUpdateRequested(): void + { + $this->FireEvent(EVENT_DB_UPDATE_REQUESTED); + } + + /** + * @inheritDoc + * @since 3.1.0 + */ + final protected function EventCheckToUpdate(): void + { + $this->FireEvent(EVENT_DB_CHECK_TO_UPDATE); + } + + /** + * @inheritDoc + * @since 3.1.0 + */ + final protected function EventCheckToUpdateFailed(array $aData): void + { + $this->FireEvent(EVENT_DB_CHECK_TO_UPDATE_FAILED, $aData); + } + + /** + * @inheritDoc + * @since 3.1.0 + */ + final protected function EventAboutToUpdate(): void + { + $this->FireEvent(EVENT_DB_ABOUT_TO_UPDATE); + } + + /** + * @inheritDoc + * @since 3.1.0 + */ + final protected function EventUpdateDone(array $aData): void + { + $this->FireEvent(EVENT_DB_UPDATE_DONE, $aData); + } + + ////////////// + /// DELETE + /// + + /** + * @inheritDoc + * @since 3.1.0 + */ + final protected function EventCheckToDelete(): void + { + $this->FireEvent(EVENT_DB_CHECK_TO_DELETE); + } + + /** + * @inheritDoc + * @since 3.1.0 + */ + final protected function EventCheckToDeleteFailed(array $aData): void + { + $this->FireEvent(EVENT_DB_CHECK_TO_DELETE_FAILED, $aData); + } + + /** + * @inheritDoc + * @since 3.1.0 + */ + final protected function EventAboutToDelete(): void + { + $this->FireEvent(EVENT_DB_ABOUT_TO_DELETE); + } + + /** + * @inheritDoc + * @since 3.1.0 + */ + final protected function EventDeleteDone(): void + { + $this->FireEvent(EVENT_DB_DELETE_DONE); } /** @@ -5694,70 +5823,7 @@ JS */ final protected function EventComputeValues(): void { - $this->FireEvent(EVENT_SERVICE_DB_COMPUTE_VALUES); - } - - /** - * @inheritDoc - * @throws \CoreException - */ - final protected function EventCheckToWrite(): void - { - $this->FireEvent(EVENT_SERVICE_DB_CHECK_TO_WRITE); - } - - /** - * @inheritDoc - * @throws \CoreException - */ - final protected function EventCheckToDelete(): void - { - $this->FireEvent(EVENT_SERVICE_DB_CHECK_TO_DELETE); - } - - /** - * @inheritDoc - * @throws \CoreException - */ - final protected function EventUpdateRequested(): void - { - $this->FireEvent(EVENT_SERVICE_DB_UPDATE_REQUESTED); - } - - /** - * @inheritDoc - * @throws \CoreException - */ - final protected function EventUpdateBefore(): void - { - $this->FireEvent(EVENT_SERVICE_DB_ABOUT_TO_UPDATE); - } - - /** - * @inheritDoc - * @throws \CoreException - */ - final protected function EventUpdateAfter(array $aEventData): void - { - $this->FireEvent(EVENT_SERVICE_DB_UPDATE_DONE, $aEventData); - } - - /** - * @inheritDoc - * @throws \CoreException - */ - final protected function EventDeleteBefore(): void - { - $this->FireEvent(EVENT_SERVICE_DB_ABOUT_TO_DELETE); - } - - /** - * @inheritDoc - * @throws \CoreException - */ - final protected function EventDeleteAfter(): void - { - $this->FireEvent(EVENT_SERVICE_DB_DELETE_DONE); + $this->FireEvent(EVENT_DB_COMPUTE_VALUES); } /** @@ -5766,21 +5832,22 @@ JS */ final protected function EventArchive(): void { - $this->FireEvent(EVENT_SERVICE_DB_ARCHIVE); + $this->FireEvent(EVENT_DB_ARCHIVE); } /** * @inheritDoc * @throws \CoreException */ - final protected function EventUnarchive(): void + final protected function EventUnArchive(): void { - $this->FireEvent(EVENT_SERVICE_DB_UNARCHIVE); + $this->FireEvent(EVENT_DB_UNARCHIVE); } /** * Append $iFlags to $sAttCode attribute in $sTargetState * + * @api * @param string $sAttCode * @param int $iFlags * @param string $sTargetState @@ -5803,6 +5870,7 @@ JS /** * Force $iFlags to $sAttCode attribute in $sTargetState * + * @api * @param string $sAttCode * @param int $iFlags * @param string $sTargetState @@ -5833,7 +5901,7 @@ JS $aEventData = [ 'target_state' => $sTargetState, ]; - $this->FireEvent(EVENT_SERVICE_DB_SET_ATTRIBUTES_FLAGS, $aEventData); + $this->FireEvent(EVENT_DB_SET_ATTRIBUTES_FLAGS, $aEventData); } $iFlags = $this->aAttributesFlags[$sTargetState][$sAttCode]['flags'] ?? 0; $aReasons += ($this->aAttributesFlags[$sTargetState][$sAttCode]['reasons'] ?? []); @@ -5845,6 +5913,7 @@ JS /** * Append $iFlags to $sAttCode attribute in initial state * + * @api * @param string $sAttCode * @param int $iFlags * @param string|null $sReason @@ -5866,6 +5935,7 @@ JS /** * Force $iFlags to $sAttCode attribute in initial state * + * @api * @param string $sAttCode * @param int $iFlags * @param string|null $sReason @@ -5892,7 +5962,7 @@ JS { if (!isset($this->aInitialAttributesFlags)) { $this->aInitialAttributesFlags = []; - $this->FireEvent(EVENT_SERVICE_DB_SET_INITIAL_ATTRIBUTES_FLAGS); + $this->FireEvent(EVENT_DB_SET_INITIAL_ATTRIBUTES_FLAGS); } $iFlags = $this->aInitialAttributesFlags[$sAttCode]['flags'] ?? 0; $aReasons += ($this->aInitialAttributesFlags[$sAttCode]['reasons'] ?? []); diff --git a/application/datamodel.application.xml b/application/datamodel.application.xml index 3057483f2..61541c3f5 100644 --- a/application/datamodel.application.xml +++ b/application/datamodel.application.xml @@ -186,8 +186,25 @@ - - An object insert in the database has been requested. All changes to the object will be persisted automatically. + + An object needs to be recomputed after changes + + cmdbAbstractObject + + DBObject::ComputeValues + + + The object inserted + DBObject + + + Debug string + string + + + + + An object create in the database has been requested. All changes to the object will be persisted automatically. cmdbAbstractObject @@ -203,8 +220,46 @@ - - An object is about to be inserted in the database (no change possible) + + Check an object before it is created into the database (no change possible). Call DBObject::AddCheckIssue() to signal an issue + + cmdbAbstractObject + + cmdbAbstractObject::DoCheckToWrite + + + The object to check + DBObject + + + Debug string + string + + + + + A check has failed, it is not possible to create the object + + cmdbAbstractObject + + cmdbAbstractObject::DoCheckToWrite + + + Array of the issues (string) that prevented the object creation + array + + + The object to check + DBObject + + + Debug string + string + + + + + An object is about to be created in the database (no change possible) cmdbAbstractObject @@ -220,8 +275,8 @@ - - An object has been inserted into the database (but not reloaded). All changes to the object will be persisted automatically. + + An object has been created into the database. The modifications can be propagated to other objects. cmdbAbstractObject @@ -237,7 +292,24 @@ - + + An object needs to be recomputed after changes + + cmdbAbstractObject + + DBObject::ComputeValues + + + The object inserted + DBObject + + + Debug string + string + + + + An object update has been requested. All changes to the object will be persisted automatically. cmdbAbstractObject @@ -254,7 +326,45 @@ - + + Check an object before it is written into the database (no change possible). Call DBObject::AddCheckIssue() to signal an issue + + cmdbAbstractObject + + cmdbAbstractObject::DoCheckToWrite + + + The object to check + DBObject + + + Debug string + string + + + + + A check has failed, it is not possible to update the object + + cmdbAbstractObject + + cmdbAbstractObject::DoCheckToWrite + + + Array of the issues (string) that prevented the object update + array + + + The object to check + DBObject + + + Debug string + string + + + + An object is about to be updated in the database (no change possible) cmdbAbstractObject @@ -271,8 +381,8 @@ - - An object has been updated into the database and reloaded. All changes to the object will be persisted automatically. + + An object has been updated into the database and reloaded. cmdbAbstractObject @@ -288,7 +398,45 @@ - + + Check an object before it is deleted from the database. Call DBObject::AddDeleteIssue() to signal an issue + + cmdbAbstractObject + + cmdbAbstractObject::DoCheckToDelete + + + The object to check + DBObject + + + Debug string + string + + + + + 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 is about to be deleted in the database cmdbAbstractObject @@ -305,7 +453,7 @@ - + An object has been deleted into the database cmdbAbstractObject @@ -322,7 +470,7 @@ - + A stimulus is about to be applied to an object cmdbAbstractObject @@ -354,7 +502,7 @@ - + A stimulus has been applied to an object cmdbAbstractObject @@ -386,7 +534,7 @@ - + A stimulus has failed cmdbAbstractObject @@ -422,7 +570,7 @@ - + An object has been re-loaded from the database cmdbAbstractObject @@ -438,7 +586,7 @@ - + An object needs to be recomputed after changes cmdbAbstractObject @@ -455,41 +603,7 @@ - - Check an object before it is written into the database (no change possible). Call DBObject::AddCheckIssue() to signal an issue - - cmdbAbstractObject - - cmdbAbstractObject::DoCheckToWrite - - - The object to check - DBObject - - - Debug string - string - - - - - Check an object before it is deleted from the database (no change possible). Call DBObject::AddDeleteIssue() to signal an issue - - cmdbAbstractObject - - cmdbAbstractObject::DoCheckToDelete - - - The object to check - DBObject - - - Debug string - string - - - - + An object has been archived cmdbAbstractObject @@ -505,7 +619,7 @@ - + An object has been unarchived cmdbAbstractObject @@ -521,7 +635,7 @@ - + Set object attributes flags. Call cmdbAbstractObject::AddAttributeFlags() for all the attributes to be set for this target state. cmdbAbstractObject @@ -541,7 +655,7 @@ - + Set object initial attributes flags. Call cmdbAbstractObject::AddInitialAttributeFlags() for all the initial attributes to be set initially. cmdbAbstractObject diff --git a/core/dbobject.class.php b/core/dbobject.class.php index b6f44d6e0..8164cc90f 100644 --- a/core/dbobject.class.php +++ b/core/dbobject.class.php @@ -355,7 +355,7 @@ abstract class DBObject implements iDisplay public function Reload($bAllowAllData = false) { assert($this->m_bIsInDB); - $this->FireEvent(EVENT_SERVICE_DB_OBJECT_RELOAD); + $this->FireEvent(EVENT_DB_OBJECT_RELOAD); $aRow = MetaModel::MakeSingleRow(get_class($this), $this->m_iKey, false /* must be found */, true /* AllowAllData */); if (empty($aRow)) { @@ -2357,10 +2357,6 @@ abstract class DBObject implements iDisplay $this->DoComputeValues(); } - $this->SetReadOnly('No modification allowed during CheckToWrite'); - $this->EventCheckToWrite(); - $this->SetReadWrite(); - $this->DoCheckToWrite(); $oKPI->ComputeStats('CheckToWrite', get_class($this)); if (count($this->m_aCheckIssues) == 0) @@ -2969,8 +2965,9 @@ abstract class DBObject implements iDisplay $sRootClass = MetaModel::GetRootClass($sClass); // Ensure the update of the values (we are accessing the data directly) + $this->EventCreateComputeValues(); $this->DoComputeValues(); - $this->EventInsertRequested(); + $this->EventCreateRequested(); $this->OnInsert(); if ($this->m_iKey < 0) { @@ -2986,14 +2983,19 @@ abstract class DBObject implements iDisplay } // Ultimate check - ensure DB integrity + $this->SetReadOnly('No modification allowed during CheckToCreate'); + $this->EventCheckToCreate(); + $this->SetReadWrite(); + list($bRes, $aIssues) = $this->CheckToWrite(false); if (!$bRes) { + $this->EventCheckToCreateFailed(['check_issues' => $aIssues]); throw new CoreCannotSaveObjectException(array('issues' => $aIssues, 'class' => get_class($this), 'id' => $this->GetKey())); } $this->ComputeStopWatchesDeadline(true); - $this->SetReadOnly('No modification allowed during The Event :'.EVENT_SERVICE_DB_ABOUT_TO_INSERT); - $this->EventInsertBefore(); + $this->SetReadOnly('No modification allowed during The Event :'.EVENT_DB_ABOUT_TO_INSERT); + $this->EventAboutToCreate(); $this->SetReadWrite(); $iTransactionRetry = 1; @@ -3073,7 +3075,7 @@ abstract class DBObject implements iDisplay // Prevent DBUpdate at this point (reentrance protection) MetaModel::StartReentranceProtection(Metamodel::REENTRANCE_TYPE_UPDATE, $this); - $this->EventInsertAfter(); + $this->EventCreateDone(); $this->AfterInsert(); // Activate any existing trigger @@ -3172,6 +3174,7 @@ abstract class DBObject implements iDisplay try { + $this->EventUpdateComputeValues(); $this->DoComputeValues(); $this->ComputeStopWatchesDeadline(false); $this->EventUpdateRequested(); @@ -3191,10 +3194,12 @@ abstract class DBObject implements iDisplay // Ultimate check - ensure DB integrity $this->SetReadOnly('No modification allowed during CheckToWrite'); - list($bRes, $aIssues) = $this->CheckToWrite(false); + $this->EventCheckToUpdate(); $this->SetReadWrite(); + list($bRes, $aIssues) = $this->CheckToWrite(false); if (!$bRes) { + $this->EventCheckToUpdateFailed(['check_issues' => $aIssues]); throw new CoreCannotSaveObjectException(['issues' => $aIssues, 'class' => $sClass, 'id' => $this->GetKey()]); } @@ -3229,8 +3234,8 @@ abstract class DBObject implements iDisplay $iIsTransactionRetryDelay = MetaModel::GetConfig()->Get('db_core_transactions_retry_delay_ms'); $iTransactionRetry = $iTransactionRetryCount; } - $this->SetReadOnly('No modification allowed during The Event :'.EVENT_SERVICE_DB_ABOUT_TO_UPDATE); - $this->EventUpdateBefore(); + $this->SetReadOnly('No modification allowed during The Event :'.EVENT_DB_ABOUT_TO_UPDATE); + $this->EventAboutToUpdate(); $this->SetReadWrite(); while ($iTransactionRetry > 0) @@ -3361,7 +3366,7 @@ abstract class DBObject implements iDisplay $this->m_aModifiedAtt = array(); try { - $this->EventUpdateAfter(['changes' => $aChanges]); + $this->EventUpdateDone(['changes' => $aChanges]); $this->AfterUpdate(); // Reset original values although the object has not been reloaded @@ -3610,7 +3615,7 @@ abstract class DBObject implements iDisplay return; } - $this->EventDeleteBefore(); + $this->EventAboutToDelete(); $this->OnDelete(); // Activate any existing trigger @@ -3721,7 +3726,7 @@ abstract class DBObject implements iDisplay } } - $this->EventDeleteAfter(); + $this->EventDeleteDone(); $this->AfterDelete(); @@ -3770,6 +3775,7 @@ abstract class DBObject implements iDisplay if ($oDeletionPlan->FoundStopper()) { $aIssues = $oDeletionPlan->GetIssues(); + $this->EventCheckToDeleteFailed(['check_issues' => $aIssues]); throw new DeleteException('Found issue(s)', array('target_class' => get_class($this), 'target_id' => $this->GetKey(), 'issues' => implode(', ', $aIssues))); } @@ -3925,7 +3931,7 @@ abstract class DBObject implements iDisplay 'new_state' => $sNewState, 'save_object' => !$bDoNotWrite, ]; - $this->FireEvent(EVENT_SERVICE_DB_BEFORE_APPLY_STIMULUS, $aEventData); + $this->FireEvent(EVENT_DB_BEFORE_APPLY_STIMULUS, $aEventData); // $aTransitionDef is an // array('target_state'=>..., 'actions'=>array of handlers procs, 'user_restriction'=>TBD @@ -4040,7 +4046,7 @@ abstract class DBObject implements iDisplay } } - $this->FireEvent(EVENT_SERVICE_DB_AFTER_APPLY_STIMULUS, $aEventData); + $this->FireEvent(EVENT_DB_AFTER_APPLY_STIMULUS, $aEventData); } else { @@ -4050,7 +4056,7 @@ abstract class DBObject implements iDisplay $this->m_aCurrValues[$sAttCode] = $aBackupValues[$sAttCode]; } $aEventData['action'] = $sActionDesc; - $this->FireEvent(EVENT_SERVICE_DB_APPLY_STIMULUS_FAILED, $aEventData); + $this->FireEvent(EVENT_DB_APPLY_STIMULUS_FAILED, $aEventData); } return $bSuccess; } @@ -5626,7 +5632,7 @@ abstract class DBObject implements iDisplay $this->m_aOrigValues['archive_flag'] = false; $this->m_aCurrValues['archive_date'] = null; $this->m_aOrigValues['archive_date'] = null; - $this->EventUnarchive(); + $this->EventUnArchive(); } @@ -5822,6 +5828,7 @@ abstract class DBObject implements iDisplay } /** + * @api * @param string $sIssue * * @return void @@ -5833,14 +5840,46 @@ abstract class DBObject implements iDisplay } /** + * @api * @param string $sIssue + * @param bool $bIsSecurityIssue * * @return void * @since 3.1.0 */ - final public function AddDeleteIssue(string $sIssue) + final public function AddDeleteIssue(string $sIssue, bool $bIsSecurityIssue = false) { $this->m_aDeleteIssues[] = $sIssue; + if ($bIsSecurityIssue) { + $this->m_bSecurityIssue = true; + } + } + + /** + * @api + * @param string $sAttCode + * @param array $aReasons + * @param string $sTargetState + * + * @return int + * @since 3.1.0 + */ + protected function GetExtensionsAttributeFlags(string $sAttCode, array &$aReasons, string $sTargetState): int + { + return OPT_ATT_NORMAL; + } + + /** + * @api + * @param string $sAttCode + * @param array $aReasons + * + * @return int + * @since 3.1.0 + */ + protected function GetExtensionsInitialStateAttributeFlags(string $sAttCode, array &$aReasons): int + { + return OPT_ATT_NORMAL; } /** @@ -5865,11 +5904,15 @@ abstract class DBObject implements iDisplay } } + ////////////////// + /// CREATE + /// + /** * @return void * @since 3.1.0 */ - protected function EventInsertRequested(): void + protected function EventCreateComputeValues(): void { } @@ -5877,11 +5920,7 @@ abstract class DBObject implements iDisplay * @return void * @since 3.1.0 */ - protected function EventInsertBefore(): void - { - } - - protected function EventInsertAfter(): void + protected function EventCreateRequested(): void { } @@ -5889,7 +5928,7 @@ abstract class DBObject implements iDisplay * @return void * @since 3.1.0 */ - protected function EventComputeValues(): void + protected function EventCheckToCreate(): void { } @@ -5897,7 +5936,7 @@ abstract class DBObject implements iDisplay * @return void * @since 3.1.0 */ - protected function EventCheckToWrite(): void + protected function EventCheckToCreateFailed(array $aData): void { } @@ -5905,7 +5944,27 @@ abstract class DBObject implements iDisplay * @return void * @since 3.1.0 */ - protected function EventCheckToDelete(): void + protected function EventAboutToCreate(): void + { + } + + /** + * @return void + * @since 3.1.0 + */ + protected function EventCreateDone(): void + { + } + + ///////////// + /// UPDATE + /// + + /** + * @return void + * @since 3.1.0 + */ + protected function EventUpdateComputeValues(): void { } @@ -5921,7 +5980,7 @@ abstract class DBObject implements iDisplay * @return void * @since 3.1.0 */ - protected function EventUpdateBefore(): void + protected function EventCheckToUpdate(): void { } @@ -5929,7 +5988,7 @@ abstract class DBObject implements iDisplay * @return void * @since 3.1.0 */ - protected function EventUpdateAfter(array $aEventData): void + protected function EventCheckToUpdateFailed(array $aData): void { } @@ -5937,7 +5996,7 @@ abstract class DBObject implements iDisplay * @return void * @since 3.1.0 */ - protected function EventDeleteBefore(): void + protected function EventAboutToUpdate(): void { } @@ -5945,7 +6004,51 @@ abstract class DBObject implements iDisplay * @return void * @since 3.1.0 */ - protected function EventDeleteAfter(): void + protected function EventUpdateDone(array $aData): void + { + } + + ////////////// + /// DELETE + /// + + /** + * @return void + * @since 3.1.0 + */ + protected function EventCheckToDelete(): void + { + } + + /** + * @return void + * @since 3.1.0 + */ + protected function EventCheckToDeleteFailed(array $aData): void + { + } + + /** + * @return void + * @since 3.1.0 + */ + protected function EventAboutToDelete(): void + { + } + + /** + * @return void + * @since 3.1.0 + */ + protected function EventDeleteDone(): void + { + } + + /** + * @return void + * @since 3.1.0 + */ + protected function EventComputeValues(): void { } @@ -5962,33 +6065,8 @@ abstract class DBObject implements iDisplay * @return void * @since 3.1.0 */ - protected function EventUnarchive(): void + protected function EventUnArchive(): void { } - - /** - * @param string $sAttCode - * @param array $aReasons - * @param string $sTargetState - * - * @return int - * @since 3.1.0 - */ - protected function GetExtensionsAttributeFlags(string $sAttCode, array &$aReasons, string $sTargetState): int - { - return OPT_ATT_NORMAL; - } - - /** - * @param string $sAttCode - * @param array $aReasons - * - * @return int - * @since 3.1.0 - */ - protected function GetExtensionsInitialStateAttributeFlags(string $sAttCode, array &$aReasons): int - { - return OPT_ATT_NORMAL; - } } diff --git a/test/ItopDataTestCase.php b/test/ItopDataTestCase.php index d833cb054..3cf9031f1 100644 --- a/test/ItopDataTestCase.php +++ b/test/ItopDataTestCase.php @@ -103,7 +103,7 @@ class ItopDataTestCase extends ItopTestCase $this->CreateTestOrganization(); } - EventService::RegisterListener(EVENT_SERVICE_DB_OBJECT_RELOAD, [$this, 'CountObjectReload']); + EventService::RegisterListener(EVENT_DB_OBJECT_RELOAD, [$this, 'CountObjectReload']); } /**