static function purgePositions($item) { $temp = new self(); $type = get_class($item); $temp->deleteByCriteria(array('itemtype' => $type, 'items_id' => $item->getField('id')), 1); return true; }
static function cleanForItem(CommonDBTM $item) { $temp = new self(); $temp->deleteByCriteria( array('itemtype' => $item->getType(), 'items_id' => $item->getField('id')) ); }
static function purgeProfiles(Profile $prof) { $plugprof = new self(); $plugprof->deleteByCriteria(array('profiles_id' => $prof->getField("id"))); }
/** * @param $user_ID * @param $only_dynamic (false by default) **/ static function deleteRights($user_ID, $only_dynamic = false) { $crit['users_id'] = $user_ID; if ($only_dynamic) { $crit['is_dynamic'] = '1'; } $obj = new self(); $obj->deleteByCriteria($crit); }
/** * @param $models_id * @param $infos array **/ static function manageInfos($models_id, $infos = array()) { global $DB; $info = new self(); if (isset($_POST['data']) && is_array($_POST['data']) && count($_POST['data'])) { foreach ($_POST['data'] as $id => $info_infos) { $info_infos['id'] = $id; //If no field selected, reset other values if ($info_infos['value'] == PluginDatainjectionInjectionType::NO_VALUE) { $info_infos['itemtype'] = PluginDatainjectionInjectionType::NO_VALUE; $info_infos['is_mandatory'] = 0; } else { $info_infos['is_mandatory'] = isset($info_infos['is_mandatory']) ? 1 : 0; } if ($id > 0) { $info->update($info_infos); } else { $info_infos['models_id'] = $models_id; unset($info_infos['id']); $info->add($info_infos); } } } $info->deleteByCriteria(array('models_id' => $models_id, 'value' => PluginDatainjectionInjectionType::NO_VALUE)); }
function cleanForOcsServer($ID) { $temp = new self(); $temp->deleteByCriteria(array('plugin_ocsinventoryng_ocsservers_id' => $ID)); }
/** * if Computer deleted * * @param $comp Computer object **/ static function purgeComputer(Computer $comp) { $link = new self(); $link->deleteByCriteria(array('computers_id' => $comp->getField("id"))); $reg = new PluginOcsinventoryngRegistryKey(); $reg->deleteByCriteria(array('computers_id' => $comp->getField("id"))); }
/** * */ function cleanDBonPurge() { $self = new self(); $self->deleteByCriteria(array('computers_id' => $this->fields['id'])); }
/** * if Phone purged * * @param $pho Phone object **/ static function purgePhone(Phone $pho) { $snmp = new self(); $snmp->deleteByCriteria(array('items_id' => $pho->getField("id"), 'itemtype' => $pho->getType())); $ipdiscover = new PluginOcsinventoryngIpdiscoverOcslink(); $ipdiscover->deleteByCriteria(array('items_id' => $pho->getField("id"), 'itemtype' => $pho->getType())); }
/** * @param $users_id **/ static function deleteUserPreferences($users_id) { $preference = new self(); $preference->deleteByCriteria(array('users_id' => $users_id)); }
static function deleteProfile(Profile $profile) { $fields_profile = new self(); $fields_profile->deleteByCriteria(array('profiles_id' => $profile->fields['id'])); return true; }
/** * @param $threads_id **/ static function deleteThreadDetailsByProcessID($threads_id) { $temp = new self(); $temp->deleteByCriteria(array('plugin_ocsinventoryng_threads_id' => $threads_id)); }
static function unregisterNewItemType($itemtype) { if (countElementsInTable(getTableForItemType(__CLASS__), "`itemtype`='{$itemtype}'")) { $config = new self(); $config->deleteByCriteria(array('itemtype' => $itemtype)); } }
static function purgeItem($item) { $temp = new self(); $temp->deleteByCriteria(array('documentcategories_id' => $item->getField("id"))); }
/** * Delete type from the rights * @param name the name of the type * @return nothing */ public static function deleteTypeFromProfile($itemtype) { $profile = new self(); $profile->deleteByCriteria(array("itemtype" => $itemtype)); }
/** * this function delete link on an certain mac * @param $id_links * @return none * @internal param type $plugin_ocsinventoryng_ocsservers_id string * @internal param type $ids array */ static function deleteLink($id_links) { $ids = self::getMacAdressKeyVal($id_links); foreach ($ids as $key => $id) { $disc = new self(); $disc->deleteByCriteria(array('id' => $id)); } }