Implemented the capability to modify queries by the mean of a plugin (reintegrated from branch 1.2, release candidate)

SVN:trunk[1849]
This commit is contained in:
Romain Quetiez
2012-02-08 15:16:16 +00:00
parent 20077a4c3a
commit d4816ddc51
10 changed files with 354 additions and 76 deletions

View File

@@ -93,6 +93,23 @@ abstract class CMDBObject extends DBObject
protected static $m_oCurrChange = null;
public static function SetCurrentChange(CMDBChange $oChange)
{
self::$m_oCurrChange = $oChange;
}
//
// Todo: simplify the APIs and do not pass the current change as an argument anymore
// SetCurrentChange to be invoked in very few cases (UI.php, CSV import, Data synchro)
// GetCurrentChange to be called ONCE (!) by CMDBChangeOp::OnInsert ($this->Set('change', ..GetCurrentChange())
// GetCurrentChange to create a default change if not already done in the current context
//
public static function GetCurrentChange()
{
return self::$m_oCurrChange;
}
private function RecordObjCreation(CMDBChange $oChange)
{
$oMyChangeOp = MetaModel::NewObject("CMDBChangeOpCreate");