main/core/Controller/APINew/Model/HasOrganizationsTrait.php
public function addOrganizationsAction($id, $class, Request $request)
    {
        $object = $this->find($class, $id);
        $organizations = $this->decodeIdsString($request, 'Claroline\CoreBundle\Entity\Organization\Organization');
        $this->crud->patch($object, 'organization', Crud::COLLECTION_ADD, $organizations);

        return new JsonResponse(
            $this->serializer->serialize($object)
        );
    }
public function addOrganizationsAction($id, $class, Request $request)
    {
        $object = $this->find($class, $id);
        $organizations = $this->decodeIdsString($request, 'Claroline\CoreBundle\Entity\Organization\Organization');
        $this->crud->patch($object, 'organization', Crud::COLLECTION_ADD, $organizations);

        return new JsonResponse(
            $this->serializer->serialize($object)
        );
    }
public function addOrganizationsAction ( $ id , $ class , Request $ request ) { $ object = $ this -> find ( $ class , $ id ) ; $ organizations = $ this -> decodeIdsString ( $ request , 'Claroline\CoreBundle\Entity\Organization\Organization' ) ; $ this -> crud -> patch ( $ object , 'organization' , Crud :: COLLECTION_ADD , $ organizations ) ; return new JsonResponse ( $ this -> serializer -> serialize ( $ object ) ) ; }
Adds organizations to the collection.

@EXT\Route("/{id}/organization")
@EXT\Method("PATCH")

@param string  $id
@param string  $class
@param Request $request

@return JsonResponse
Adds organizations to the collection .