@@ -311,39 +311,6 @@ private function createDeleteForm(User $user)
311
311
;
312
312
}
313
313
314
- /**
315
- * Fetch all Users.
316
- *
317
- * @Route("/all", name="admin_users_all")
318
- * @Method("GET")
319
- */
320
- public function cgetAction ()
321
- {
322
- //security.yml is configured to allow anonymous access to controllers
323
- //checking for authorization in each controller allows more flexibility
324
- //to change this remove anonymous: true in security.yml on firewall
325
- if (!$ this ->get ('security.authorization_checker ' )->isGranted ('IS_AUTHENTICATED_FULLY ' )) {
326
- throw $ this ->createAccessDeniedException ();
327
- }
328
-
329
- /*$em = $this->getDoctrine()->getEntityManager();
330
- $repository = $em->getRepository("ApiBundle:User");
331
- $users = $repository->findAll();
332
- */
333
-
334
- $ repository = $ this ->getDoctrine ()->getRepository ("ApiBundle:User " );
335
-
336
- // createQueryBuilder() automatically selects FROM ApiBundle:User
337
- // and aliases it to "u"
338
- $ query = $ repository ->createQueryBuilder ('u ' )->select ('u.username ' , 'u.email ' )->getQuery ();
339
-
340
- $ users = $ query ->getResult ();
341
-
342
- $ this ->logMessage (200 , 'success ' , 'Users fetched ' );
343
-
344
- return $ this ->render ('@ApiBundle/Resources/views/default/users.html.twig ' , ['users ' => $ users ]);
345
- }
346
-
347
314
private function logMessageAndFlash ($ code = 200 , $ type = 'success ' , $ logMsg = '' , $ flashMsg = '' , $ locale = 'en ' )
348
315
{
349
316
$ this ->logMessage ($ code , $ type , $ logMsg );
0 commit comments