X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FAnnotationBundle%2FController%2FWallabagAnnotationController.php;h=3a7421c74ddc6fcf7225b2ef98d828a7e445ff5d;hb=2a1ceb67b4400f46f4d3067e887ff54aa906f0a2;hp=2b4b0e8dd071245afde9e864fca0c119c14a455f;hpb=2c3e148b0029a094431622feac79fafcd0d43fc8;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/AnnotationBundle/Controller/WallabagAnnotationController.php b/src/Wallabag/AnnotationBundle/Controller/WallabagAnnotationController.php index 2b4b0e8d..3a7421c7 100644 --- a/src/Wallabag/AnnotationBundle/Controller/WallabagAnnotationController.php +++ b/src/Wallabag/AnnotationBundle/Controller/WallabagAnnotationController.php @@ -3,9 +3,9 @@ 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; @@ -28,10 +28,10 @@ class WallabagAnnotationController extends FOSRestController ->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); } @@ -64,7 +64,7 @@ class WallabagAnnotationController extends FOSRestController $em->persist($annotation); $em->flush(); - $json = $this->get('serializer')->serialize($annotation, 'json'); + $json = $this->get('jms_serializer')->serialize($annotation, 'json'); return JsonResponse::fromJsonString($json); } @@ -99,7 +99,7 @@ class WallabagAnnotationController extends FOSRestController $em->persist($annotation); $em->flush(); - $json = $this->get('serializer')->serialize($annotation, 'json'); + $json = $this->get('jms_serializer')->serialize($annotation, 'json'); return JsonResponse::fromJsonString($json); } @@ -124,7 +124,7 @@ class WallabagAnnotationController extends FOSRestController $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); }