aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/ApiBundle/Controller/SearchRestController.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/ApiBundle/Controller/SearchRestController.php')
-rw-r--r--src/Wallabag/ApiBundle/Controller/SearchRestController.php19
1 files changed, 0 insertions, 19 deletions
diff --git a/src/Wallabag/ApiBundle/Controller/SearchRestController.php b/src/Wallabag/ApiBundle/Controller/SearchRestController.php
index 6620107d..f8da0ad4 100644
--- a/src/Wallabag/ApiBundle/Controller/SearchRestController.php
+++ b/src/Wallabag/ApiBundle/Controller/SearchRestController.php
@@ -4,7 +4,6 @@ namespace Wallabag\ApiBundle\Controller;
4 4
5use Hateoas\Configuration\Route; 5use Hateoas\Configuration\Route;
6use Hateoas\Representation\Factory\PagerfantaFactory; 6use Hateoas\Representation\Factory\PagerfantaFactory;
7use JMS\Serializer\SerializationContext;
8use Nelmio\ApiDocBundle\Annotation\ApiDoc; 7use Nelmio\ApiDocBundle\Annotation\ApiDoc;
9use Pagerfanta\Adapter\DoctrineORMAdapter; 8use Pagerfanta\Adapter\DoctrineORMAdapter;
10use Pagerfanta\Pagerfanta; 9use Pagerfanta\Pagerfanta;
@@ -64,22 +63,4 @@ class SearchRestController extends WallabagRestController
64 63
65 return $this->sendResponse($paginatedCollection); 64 return $this->sendResponse($paginatedCollection);
66 } 65 }
67
68 /**
69 * Shortcut to send data serialized in json.
70 *
71 * @param mixed $data
72 *
73 * @return JsonResponse
74 */
75 private function sendResponse($data)
76 {
77 // https://github.com/schmittjoh/JMSSerializerBundle/issues/293
78 $context = new SerializationContext();
79 $context->setSerializeNull(true);
80
81 $json = $this->get('jms_serializer')->serialize($data, 'json', $context);
82
83 return (new JsonResponse())->setJson($json);
84 }
85} 66}