plugin/reservation/Controller/API/ResourceController.php
public function listOrganizationsAction($id, Request $request)
    {
        $resource = $this->resourceRepo->findOneBy(['uuid' => $id]);
        $organizations = !empty($resource) ? $resource->getOrganizations() : [];
        $organizationsUuids = array_map(function (Organization $organization) {
            return $organization->getUuid();
        }, $organizations);

        return new JsonResponse(
            $this->finder->search('Claroline\CoreBundle\Entity\Organization\Organization', array_merge(
                $request->query->all(),
                ['hiddenFilters' => ['whitelist' => $organizationsUuids]]
            ))
        );
    }
public function listOrganizationsAction($id, Request $request)
    {
        $resource = $this->resourceRepo->findOneBy(['uuid' => $id]);
        $organizations = !empty($resource) ? $resource->getOrganizations() : [];
        $organizationsUuids = array_map(function (Organization $organization) {
            return $organization->getUuid();
        }, $organizations);

        return new JsonResponse(
            $this->finder->search('Claroline\CoreBundle\Entity\Organization\Organization', array_merge(
                $request->query->all(),
                ['hiddenFilters' => ['whitelist' => $organizationsUuids]]
            ))
        );
    }
public function listOrganizationsAction ( $ id , Request $ request ) { $ resource = $ this -> resourceRepo -> findOneBy ( [ 'uuid' => $ id ] ) ; $ organizations = ! empty ( $ resource ) ? $ resource -> getOrganizations ( ) : [ ] ; $ organizationsUuids = array_map ( function ( Organization $ organization ) { return $ organization -> getUuid ( ) ; } , $ organizations ) ; return new JsonResponse ( $ this -> finder -> search ( 'Claroline\CoreBundle\Entity\Organization\Organization' , array_merge ( $ request -> query -> all ( ) , [ 'hiddenFilters' => [ 'whitelist' => $ organizationsUuids ] ] ) ) ) ; }
List organizations of the collection.

@Route("/{id}/organization")
@Method("GET")

@param string  $id
@param Request $request

@return JsonResponse
List organizations of the collection .