DBObject addon,bizmodel false autoincrement attachment id expire false temp_id true item_class false item_id true item_class item_org_id 0 true creation_date true user_id true DEL_MANUAL User false contact_id true DEL_MANUAL Person false false public Overload-DBObject SetCurrentDateIfNull('creation_date'); $iUserId = CMDBChange::GetCurrentUserId(); if(utils::IsNotNullOrEmptyString($iUserId)){ $this->SetIfNull('user_id', $iUserId); // Get Contact from user $oUser = MetaModel::GetObject('User', $iUserId, true, true); $this->SetIfNull('contact_id', $oUser->Get('contactid')); } return parent::DBInsertNoReload(); } ]]> true public Overload-ExNihilo false public Overload-ExNihilo GetKey(); $this->Set('item_class', $sClass); $this->Set('item_id', $iItemId); $aCallSpec = array($sClass, 'MapContextParam'); if (is_callable($aCallSpec)) { $sAttCode = call_user_func($aCallSpec, 'org_id'); // Returns null when there is no mapping for this parameter if (MetaModel::IsValidAttCode($sClass, $sAttCode)) { $iOrgId = $oItem->Get($sAttCode); if ($iOrgId > 0) { if ($iOrgId != $this->Get('item_org_id')) { $this->Set('item_org_id', $iOrgId); if ($bUpdateOnChange) { $this->DBUpdate(); } } } } } }]]> /** * Give a default value for item_org_id (if relevant...) * @return void */ false public Overload-ExNihilo Set('item_org_id', $oCurrentPerson->Get($sAttCode)); } } } } }]]>
10 20 30 40
10 20 30 10 20 30 40
Attachment added Attachment::AfterUpdate cmdbAbstractObject The object where the attachment is added DBObject The attachment added to the objet DBObject Debug string string Attachment removed Attachment::AfterUpdate cmdbAbstractObject The object where the attachment is removed DBObject The attachment removed DBObject Debug string string