Esempio n. 1
0
 public function remove_product($parameters)
 {
     try {
         $sql = 'UPDATE `' . DB_TUNA . '`.`products` SET `status` = "disabled" WHERE `id` = "' . $parameters['id'] . '"';
         $GLOBALS[TUNA_RW]->query($sql);
         /***SYNC_TUNA**/
         if (SYNC_TUNA_ACTIVE) {
             TunaCoupler::sync_disable_product($parameters['id']);
         }
         /***SYNC_TUNA**/
     } catch (Exception $e) {
         throw new Error(404, 'There aren\'t valid gamespace/product to remove');
     }
 }
Esempio n. 2
0
 public function delete($parameters)
 {
     $id = (int) array_get($parameters, 'id');
     if (!ctype_digit(trim($id)) || (int) $id == 0) {
         throw new Error(400, 'Incorrect Id Value');
     }
     $sql = ' UPDATE `' . DB_TUNA . '`.`client_ids` SET `status`="deleted" WHERE `id`="' . $id . '"';
     $GLOBALS[TUNA_RW]->query($sql);
     if ($GLOBALS[TUNA_RW]->affectedRows() > 0) {
         /***SYNC_TUNA**/
         if (SYNC_TUNA_ACTIVE) {
             TunaCoupler::sync_delete_clientid($this->id);
         }
         /***SYNC_TUNA**/
         return true;
     }
     throw new Error(404, 'The ClientId Wasn\'t Found');
 }