Beispiel #1
0
 /**
  * Exemplo de serviço a ser usado por programas offline.
  */
 public function dadosPessoaByNome()
 {
     try {
         $db = $this->getDatabase('exemplos');
         try {
             $transaction = $db->beginTransaction();
             $pessoa = new Pessoa();
             $this->data->result = $pessoa->listByFilter($this->data)->asQuery()->getResult();
             $transaction->commit();
         } catch (\Exception $e) {
             // rollback da transação em caso de algum erro
             $transaction->rollback();
             $this->data->error = true;
             $this->data->result = $e->getMessage();
         }
     } catch (\Exception $e) {
         $this->data->error = true;
         $this->data->result = $e->getMessage();
     }
     $this->renderJSON();
 }
 public function lookup()
 {
     $model = new Pessoa();
     $this->data->query = $model->listByFilter($this->data->filter)->asQuery();
     $this->render();
 }
 public function formNew()
 {
     $pessoa = new Pessoa($this->data->id);
     $this->data->options = $pessoa->listByFilter($filter)->asQuery()->chunkResult(0, 1);
     $this->render();
 }