Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * @Route("/getTests", name="get_tests")
- */
- public function getTestsAction()
- {
- $tests = $this->getDoctrine()->getRepository('AppBundle:Test')->findAll();
- $result = [];
- foreach ($tests as $test) {
- $result[] = [
- 'name' => $test->getName(),
- 'id' => $test->getId(),
- 'price' => $test->getPrice(),
- ];
- }
- return new JsonResponse($result);
- }
Add Comment
Please, Sign In to add comment