aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Helper/EntriesExport.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/CoreBundle/Helper/EntriesExport.php')
-rw-r--r--src/Wallabag/CoreBundle/Helper/EntriesExport.php17
1 files changed, 5 insertions, 12 deletions
diff --git a/src/Wallabag/CoreBundle/Helper/EntriesExport.php b/src/Wallabag/CoreBundle/Helper/EntriesExport.php
index f073ed7f..c14f9d72 100644
--- a/src/Wallabag/CoreBundle/Helper/EntriesExport.php
+++ b/src/Wallabag/CoreBundle/Helper/EntriesExport.php
@@ -5,13 +5,9 @@ namespace Wallabag\CoreBundle\Helper;
5use PHPePub\Core\EPub; 5use PHPePub\Core\EPub;
6use PHPePub\Core\Structure\OPF\DublinCore; 6use PHPePub\Core\Structure\OPF\DublinCore;
7use Symfony\Component\HttpFoundation\Response; 7use Symfony\Component\HttpFoundation\Response;
8use Symfony\Component\Serializer\Serializer; 8use JMS\Serializer;
9use Symfony\Component\Serializer\Encoder\XmlEncoder; 9use JMS\Serializer\SerializerBuilder;
10use Symfony\Component\Serializer\Encoder\JsonEncoder; 10use JMS\Serializer\SerializationContext;
11use Symfony\Component\Serializer\Normalizer\PropertyNormalizer;
12use Symfony\Component\Serializer\Mapping\Loader\AnnotationLoader;
13use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactory;
14use Doctrine\Common\Annotations\AnnotationReader;
15 11
16class EntriesExport 12class EntriesExport
17{ 13{
@@ -365,12 +361,9 @@ class EntriesExport
365 */ 361 */
366 private function prepareSerializingContent($format) 362 private function prepareSerializingContent($format)
367 { 363 {
368 $encoders = array(new XmlEncoder(), new JsonEncoder()); 364 $serializer = SerializerBuilder::create()->build();
369 $classMetadataFactory = new ClassMetadataFactory(new AnnotationLoader(new AnnotationReader()));
370 $normalizers = array(new PropertyNormalizer($classMetadataFactory));
371 $serializer = new Serializer($normalizers, $encoders);
372 365
373 return $serializer->serialize($this->entries, $format, array('groups' => array('entries_for_user'))); 366 return $serializer->serialize($this->entries, $format, SerializationContext::create()->setGroups(array('entries_for_user')));
374 } 367 }
375 368
376 /** 369 /**