aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/Wallabag/CoreBundle/Entity/Entry.php2
-rw-r--r--src/Wallabag/CoreBundle/Helper/EntriesExport.php17
2 files changed, 6 insertions, 13 deletions
diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php
index a2bb507e..5aa582f8 100644
--- a/src/Wallabag/CoreBundle/Entity/Entry.php
+++ b/src/Wallabag/CoreBundle/Entity/Entry.php
@@ -6,7 +6,7 @@ use Doctrine\Common\Collections\ArrayCollection;
6use Doctrine\ORM\Mapping as ORM; 6use Doctrine\ORM\Mapping as ORM;
7use Symfony\Component\Validator\Constraints as Assert; 7use Symfony\Component\Validator\Constraints as Assert;
8use Hateoas\Configuration\Annotation as Hateoas; 8use Hateoas\Configuration\Annotation as Hateoas;
9use Symfony\Component\Serializer\Annotation\Groups; 9use JMS\Serializer\Annotation\Groups;
10use JMS\Serializer\Annotation\XmlRoot; 10use JMS\Serializer\Annotation\XmlRoot;
11use Wallabag\UserBundle\Entity\User; 11use Wallabag\UserBundle\Entity\User;
12 12
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 /**