public function getGroup(EventInterface $event) {
        $route = $event->getRequest()->getRoute();
        $groupName = $route->get('group');

        $adapter = $event->getAccessControl();

        if (!$adapter->groupExists($groupName)) {
            throw new ResourceException('Resource group not found', 404);
        }

        $resources = $adapter->getGroup($groupName);

        $model = new GroupModel();
        $model->setName($groupName);
        $model->setResources($resources);

        $response = $event->getResponse();
        $response->setModel($model);
    }
public function getGroup(EventInterface $event) {
        $route = $event->getRequest()->getRoute();
        $groupName = $route->get('group');

        $adapter = $event->getAccessControl();

        if (!$adapter->groupExists($groupName)) {
            throw new ResourceException('Resource group not found', 404);
        }

        $resources = $adapter->getGroup($groupName);

        $model = new GroupModel();
        $model->setName($groupName);
        $model->setResources($resources);

        $response = $event->getResponse();
        $response->setModel($model);
    }
public function getGroup ( EventInterface $ event ) { $ route = $ event -> getRequest ( ) -> getRoute ( ) ; $ groupName = $ route -> get ( 'group' ) ; $ adapter = $ event -> getAccessControl ( ) ; if ( ! $ adapter -> groupExists ( $ groupName ) ) { throw new ResourceException ( 'Resource group not found' , 404 ) ; } $ resources = $ adapter -> getGroup ( $ groupName ) ; $ model = new GroupModel ( ) ; $ model -> setName ( $ groupName ) ; $ model -> setResources ( $ resources ) ; $ response = $ event -> getResponse ( ) ; $ response -> setModel ( $ model ) ; }
Get the resources associated with a specific group

@param EventInterface $event The current event
Get the resources associated with a specific group