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.
package | Extensibility |
---|---|
api |
OnCheckToDelete(\DBObject $oObject) : string[]
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.
\DBObject
The target object
string[]
A list of errors message. An error message is made of one line and it can be displayed to the end-user.OnCheckToWrite(\DBObject $oObject) : string[]
The GUI calls this verb and reports any issue. Anyhow, this API can be called in other contexts such as the CSV import tool.
\DBObject
The target object
string[]
A list of errors message. An error message is made of one line and it can be displayed to the end-user.OnDBDelete(\DBObject $oObject, \CMDBChange | null $oChange) : void
The method is called right before the object will be deleted from the database.
\DBObject
The target object
\CMDBChange
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(\DBObject $oObject, \CMDBChange | null $oChange) : void
The method is called right after the object has been written to the database.
\DBObject
The target object
\CMDBChange
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(\DBObject $oObject, \CMDBChange | null $oChange) : void
The method is called right after the object has been written to the database.
\DBObject
The target object
\CMDBChange
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
OnIsModified(\DBObject $oObject) : boolean
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".
\DBObject
The target object
boolean
True if something has changed for the target object