public function index() { try { //$repository = $this->entityManager->getRepository('Usuarios'); //$users = $repository->findAll(); $user = $this->entityManager->find('Usuarios', 2); $data = array('user' => $user->getNome(), 'pass' => $user->getIdade()); helpers::jsonResponse(0, 'Success', $data); } catch (Exception $ex) { helpers::jsonResponse(1, 'Error: ' . $ex->getMessage(), NULL); } }
public function index() { $results[] = array('name' => 'listagem de Usuarios', 'endpoint' => 'users'); //$u = new Usuarios(); //$u->setNome('teste'); //$u->setIdade(27); //$this->entityManager->persist($u); //$this->entityManager->flush(); //$results = $u->getId(); //helpers::jsonResponse(NULL, 'result', $results); $results = $u->getId(); helpers::jsonResponse(NULL, 'result', $results); }