Esempio n. 1
0
 /**
  * Delete items
  *
  * {@source}
  * @access public
  * @static
  * @since 1.8
  * @version 1
  *
  * @static
  * @param array $itemids
  * @return array|boolean
  */
 public static function delete($itemids)
 {
     $result = delete_item($itemids);
     if ($result) {
         return $itemids;
     } else {
         self::$error = array('error' => ZBX_API_ERROR_INTERNAL, 'data' => 'Internal zabbix error');
         return false;
     }
 }
Esempio n. 2
0
 private static function item($action, $params)
 {
     CItem::$error = array();
     switch ($action) {
         case 'add':
             $result = CItem::add($params);
             break;
         case 'get':
             $result = CItem::get($params);
             break;
         case 'getById':
             $result = CItem::getById($params);
             break;
         case 'getId':
             $result = CItem::getId($params);
             break;
         case 'update':
             $result = CItem::update($params);
             break;
         case 'delete':
             $result = CItem::delete($params);
             break;
         default:
             self::$result = array('error' => ZBX_API_ERROR_NO_METHOD, 'data' => 'Method: "' . $action . '" doesn\'t exist.');
             return;
             //exit function
     }
     if ($result !== false) {
         self::$result = array('result' => $result);
     } else {
         self::$result = CItem::$error;
     }
 }
Esempio n. 3
0
 private static function item($action, $params)
 {
     CItem::$error = array();
     switch ($action) {
         default:
             $result = call_user_func(array('CItem', $action), $params);
     }
     self::$result = $result;
 }