public function favouriteToggleAction(User $user, Request $request)
    {
        $nodes = $this->decodeIdsString($request, 'Claroline\CoreBundle\Entity\Resource\ResourceNode');
        $this->manager->toggleFavourites($user, $nodes);

        return new JsonResponse(null, 204);
    }
public function favouriteToggleAction(User $user, Request $request)
    {
        $nodes = $this->decodeIdsString($request, 'Claroline\CoreBundle\Entity\Resource\ResourceNode');
        $this->manager->toggleFavourites($user, $nodes);

        return new JsonResponse(null, 204);
    }
public function favouriteToggleAction ( User $ user , Request $ request ) { $ nodes = $ this -> decodeIdsString ( $ request , 'Claroline\CoreBundle\Entity\Resource\ResourceNode' ) ; $ this -> manager -> toggleFavourites ( $ user , $ nodes ) ; return new JsonResponse ( null , 204 ) ; }
Creates or deletes favourite resources.

@EXT\Route("resources/toggle", name="hevinci_favourite_toggle")
@EXT\Method("PUT")
@EXT\ParamConverter("user", converter="current_user", options={"allowAnonymous"=false})

@param User    $user
@param Request $request

@return JsonResponse
Creates or deletes favourite resources .