You are browsing the documentation for iTop 2.7 which is not the current version.

Consider browsing to iTop 3.2 documentation

๐Ÿ”™ Back

iApplicationObjectExtension

api

Implement this interface to perform specific things when objects are manipulated

Note that those methods will be called when objects are manipulated, either in a programmatic way or through the GUI.

Public methods

OnCheckToDelete

public

Invoked to determine wether an object can be deleted from the database

The GUI calls this verb and stops the deletion process if any issue is reported.

Please not that it is not possible to cascade deletion by this mean: only stopper issues can be handled.

public OnCheckToDelete($oObject)

Parameters

types name default description
\cmdbAbstractObject $oObject The target object

Returns

array<mixed,string> A list of errors message. An error message is made of one line and it can be displayed to the end-user.

OnCheckToWrite

public

Invoked to determine whether an object can be written to the database

The GUI calls this verb and reports any issue. Anyhow, this API can be called in other contexts such as the CSV import tool.

public OnCheckToWrite($oObject)

Parameters

types name default description
\cmdbAbstractObject $oObject The target object

Returns

array<mixed,string> A list of errors message. An error message is made of one line and it can be displayed to the end-user.

OnDBDelete

public

Invoked when an object is deleted from the database

The method is called right before the object will be deleted from the database.

public OnDBDelete($oObject, $oChange = null)

Parameters

types name default description
\cmdbAbstractObject $oObject The target object
\CMDBChange|null $oChange null A change context. Since 2.0 it is fine to ignore it, as the framework does maintain this information once for all the changes made within the current page

OnDBInsert

public

Invoked when an object is created into the database

The method is called right after the object has been written to the database.

public OnDBInsert($oObject, $oChange = null)

Parameters

types name default description
\cmdbAbstractObject $oObject The target object
\CMDBChange|null $oChange null A change context. Since 2.0 it is fine to ignore it, as the framework does maintain this information once for all the changes made within the current page

OnDBUpdate

public

Invoked when an object is updated into the database. The method is called right <b>after</b> the object has been written to thedatabase.

Useful methods you can call on $oObject :

  • \DBObject::ListPreviousValuesForUpdatedAttributes() : list of changed attributes and their values before the change
  • \DBObject::Get() : for a given attribute the new value that was persisted
public OnDBUpdate($oObject, $oChange = null)

Parameters

types name default description
\cmdbAbstractObject $oObject The target object
\CMDBChange|null $oChange null A change context. Since 2.0 it is fine to ignore it, as the framework does maintain this information once for all the changes made within the current page

Tags

since 2.7.0 Nยฐ2293 can access object changes by calling {@see DBObject::ListPreviousValuesForUpdatedAttributes()} on $oObject

OnIsModified

public

Invoked to determine whether an object has been modified in memory

The GUI calls this verb to determine the message that will be displayed to the end-user. Anyhow, this API can be called in other contexts such as the CSV import tool.

If the extension returns false, then the framework will perform the usual evaluation. Otherwise, the answer is definitively "yes, the object has changed".

public OnIsModified($oObject)

Parameters

types name default description
\cmdbAbstractObject $oObject The target object

Returns

boolean True if something has changed for the target object

๐Ÿ”™ Back

2_7_0/customization/api/extensions/iapplicationobjectextension.txt ยท Last modified: 2020/04/15 15:23 by 127.0.0.1
Back to top
Contact us