namespace Wallabag\AnnotationBundle\Controller;
use FOS\RestBundle\Controller\FOSRestController;
+use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
-use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
use Wallabag\AnnotationBundle\Entity\Annotation;
use Wallabag\AnnotationBundle\Form\EditAnnotationType;
use Wallabag\AnnotationBundle\Form\NewAnnotationType;
->getDoctrine()
->getRepository('WallabagAnnotationBundle:Annotation')
->findAnnotationsByPageId($entry->getId(), $this->getUser()->getId());
- $total = count($annotationRows);
+ $total = \count($annotationRows);
$annotations = ['total' => $total, 'rows' => $annotationRows];
- $json = $this->get('serializer')->serialize($annotations, 'json');
+ $json = $this->get('jms_serializer')->serialize($annotations, 'json');
return (new JsonResponse())->setJson($json);
}
$em->persist($annotation);
$em->flush();
- $json = $this->get('serializer')->serialize($annotation, 'json');
+ $json = $this->get('jms_serializer')->serialize($annotation, 'json');
return JsonResponse::fromJsonString($json);
}
$em->persist($annotation);
$em->flush();
- $json = $this->get('serializer')->serialize($annotation, 'json');
+ $json = $this->get('jms_serializer')->serialize($annotation, 'json');
return JsonResponse::fromJsonString($json);
}
$em->remove($annotation);
$em->flush();
- $json = $this->get('serializer')->serialize($annotation, 'json');
+ $json = $this->get('jms_serializer')->serialize($annotation, 'json');
return (new JsonResponse())->setJson($json);
}