public function compraVerificada() { if (($this->email_vendedor == EMAIL_PAYPAL1 || $this->email_vendedor == EMAIL_PAYPAL2) && $this->estado == "Completed") { if (TipoTicket::existeTipo($this->item_id)) { return true; } else { Tool::log("[ERROR]El tipo de ticket no está registrado", LOG); return false; } } else { return false; } }
public function delTipo() { $db = Tool::conectaBD(); if ($db) { if (TipoTicket::existeTipo($this->id)) { $sql = "DELETE FROM TipoTicket WHERE Id=" . $this->id; $res = Tool::ejecuta($sql, $db); } else { //El id no existe $res = false; } } else { //error conectando a base de datos $res = false; } Tool::desconectaBD($db); return $res; }
/** * method Delete() * Delete a record */ function Delete($param) { try { // get the parameter $key $key = $param['key']; TTransaction::open('atividade'); // open the transaction $object = new TipoTicket($key, FALSE); // instantiates the Active Record $object->delete(); // deletes the object TTransaction::close(); // close the transaction $this->onReload($param); // reload the listing new TMessage('info', TAdiantiCoreTranslator::translate('Record deleted')); // success message } catch (Exception $e) { new TMessage('error', '<b>Error</b> ' . $e->getMessage()); // shows the exception error message TTransaction::rollback(); // undo all pending operations } }