src/Phlexible/Bundle/UserBundle/Controller/GroupsController.php
public function listAction()
    {
        $groupManager = $this->get('phlexible_user.group_manager');

        $groups = [];
        foreach ($groupManager->findAll() as $group) {
            $members = [];
            foreach ($group->getUsers() as $user) {
                $members[] = $user->getDisplayName();
            }
            sort($members);

            $groups[] = [
                'gid' => $group->getId(),
                'name' => $group->getName(),
                'readonly' => false,
                'memberCnt' => count($members),
                'members' => $members,
            ];
        }

        return new JsonResponse($groups);
    }
public function listAction()
    {
        $groupManager = $this->get('phlexible_user.group_manager');

        $groups = [];
        foreach ($groupManager->findAll() as $group) {
            $members = [];
            foreach ($group->getUsers() as $user) {
                $members[] = $user->getDisplayName();
            }
            sort($members);

            $groups[] = [
                'gid' => $group->getId(),
                'name' => $group->getName(),
                'readonly' => false,
                'memberCnt' => count($members),
                'members' => $members,
            ];
        }

        return new JsonResponse($groups);
    }
public function listAction ( ) { $ groupManager = $ this -> get ( 'phlexible_user.group_manager' ) ; $ groups = [ ] ; foreach ( $ groupManager -> findAll ( ) as $ group ) { $ members = [ ] ; foreach ( $ group -> getUsers ( ) as $ user ) { $ members [ ] = $ user -> getDisplayName ( ) ; } sort ( $ members ) ; $ groups [ ] = [ 'gid' => $ group -> getId ( ) , 'name' => $ group -> getName ( ) , 'readonly' => false , 'memberCnt' => count ( $ members ) , 'members' => $ members , ] ; } return new JsonResponse ( $ groups ) ; }
List groups.

@return JsonResponse
@Route("", name="users_groups_list")
@Method("GET")
@ApiDoc(
description="Returns a list of groups"
)
List groups .