src/AppBundle/Controller/Api/UserController.php 1 location
|
@@ 20-29 (lines=10) @@
|
| 17 |
|
* @Method("GET") |
| 18 |
|
* @return JsonResponse |
| 19 |
|
*/ |
| 20 |
|
public function listAction() |
| 21 |
|
{ |
| 22 |
|
$users = $this->getDoctrine() |
| 23 |
|
->getRepository('AppBundle:User') |
| 24 |
|
->findAll(); |
| 25 |
|
if (!$users) { |
| 26 |
|
throw new JsonHttpException(404, 'User not found.'); |
| 27 |
|
} |
| 28 |
|
return $this->json(['users' => $users], 200, [], [AbstractNormalizer::GROUPS => ['Short']]); |
| 29 |
|
} |
| 30 |
|
} |
| 31 |
|
|
src/AppBundle/Controller/UserController.php 1 location
|
@@ 150-159 (lines=10) @@
|
| 147 |
|
* @Method("GET") |
| 148 |
|
* @return JsonResponse |
| 149 |
|
*/ |
| 150 |
|
public function usersListAction() |
| 151 |
|
{ |
| 152 |
|
$users = $this->getDoctrine() |
| 153 |
|
->getRepository('AppBundle:User') |
| 154 |
|
->findAll(); |
| 155 |
|
if (!$users) { |
| 156 |
|
throw new JsonHttpException(404, 'User not found.'); |
| 157 |
|
} |
| 158 |
|
return $this->json(['users' => $users], 200, [], [AbstractNormalizer::GROUPS => ['Short']]); |
| 159 |
|
} |
| 160 |
|
} |
| 161 |
|
|