/**
  * method Delete()
  * Delete a record
  */
 function Delete($param)
 {
     try {
         $key = $param['key'];
         // get the parameter $key
         TTransaction::open('atividade');
         // open a transaction with database
         $object = new RequisitoDesenvolvimento($key, FALSE);
         // instantiates the Active Record
         $object->delete();
         // deletes the object from the database
         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
     }
 }
Esempio n. 2
0
 /**
  * Method getRequisitoDesenvolvimentos
  */
 public function getRequisitoDesenvolvimentos()
 {
     $criteria = new TCriteria();
     $criteria->add(new TFilter('ticket_id', '=', $this->id));
     return RequisitoDesenvolvimento::getObjects($criteria);
 }