function resetObject() { $racklist = getResidentRacksData(getBypassValue(), FALSE); commitResetObject(getBypassValue()); foreach ($racklist as $rack_id) { usePreparedDeleteBlade('RackThumbnail', array('rack_id' => $rack_id)); } ############################################################################################### # remain name. $object_id = getBypassValue(); $object = spotEntity('object', $object_id); usePreparedUpdateBlade('Object', array('name' => $object['name'], 'label' => ''), array('id' => $object_id)); $result = resetHost($object['name']); if (isset($result['error'])) { showError('Resetting zabbix host is failed. Error message:' . $result['error']); } # END ############################################################################################### showFuncMessage(__FUNCTION__, 'OK'); }
function resetObject() { $racklist = getResidentRacksData(getBypassValue(), FALSE); commitResetObject(getBypassValue()); foreach ($racklist as $rack_id) { usePreparedDeleteBlade('RackThumbnail', array('rack_id' => $rack_id)); } showFuncMessage(__FUNCTION__, 'OK'); }
function commitDeleteObject($object_id = 0) { // Reset most of stuff commitResetObject($object_id); // Object itself usePreparedDeleteBlade('Object', array('id' => $object_id)); // Dangling links usePreparedExecuteBlade('DELETE FROM EntityLink WHERE ' . "(parent_entity_type IN ('rack', 'row', 'location') AND parent_entity_id = ?) OR " . "(child_entity_type IN ('rack', 'row', 'location') AND child_entity_id = ?)", array($object_id, $object_id)); }