public function findByReservationDateAndResource(Reservation $reservation, $start, $end, Resource $resource)
 {
     $sql = "SELECT r FROM FormaLibre\\ReservationBundle\\Entity\\Reservation r\n        INNER JOIN Claroline\\AgendaBundle\\Entity\\Event e WITH r.event = e\n        WHERE ((e.start BETWEEN :start AND :end) OR (e.end BETWEEN :start AND :end) OR (e.start <= :start AND e.end >= :end))\n        AND e.start NOT IN (:start, :end)\n        AND e.end NOT IN (:start, :end)\n        AND r.resource = :resource AND r <> :reservation";
     $query = $this->_em->createQuery($sql);
     $query->setParameter('reservation', $reservation->getId());
     $query->setParameter('start', $start + 1);
     $query->setParameter('end', $end - 1);
     $query->setParameter('resource', $resource->getId());
     return $query->getResult();
 }
 /**
  * @EXT\Route(
  *     "/api/cursus/reservation/resource/{resource}/tag/delete",
  *     name="api_delete_cursus_reservation_resources_tag",
  *     options = {"expose"=true}
  * )
  * @EXT\ParamConverter("user", converter="current_user")
  *
  * Removes tag from reservation resource
  *
  * @return \Symfony\Component\HttpFoundation\JsonResponse
  */
 public function deleteReservationResourceTagAction(Resource $resource)
 {
     $this->tagManager->removeTaggedObjectByTagNameAndObjectIdAndClass('cursus_location', $resource->getId(), 'FormaLibre\\ReservationBundle\\Entity\\Resource');
     return new JsonResponse('success', 200);
 }