From a9f18381b444eb32bb07954227ade97a9bc793cb Mon Sep 17 00:00:00 2001 From: Dominik Pfaffenbauer Date: Thu, 10 Jan 2019 13:50:47 +0100 Subject: [PATCH] [ResourceBundle] add JMS Serializer Handler for Pimcore Objects --- .../Resources/config/services.yml | 5 ++++ .../Serialization/PimcoreObjectHandler.php | 29 +++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 src/CoreShop/Bundle/ResourceBundle/Serialization/PimcoreObjectHandler.php diff --git a/src/CoreShop/Bundle/ResourceBundle/Resources/config/services.yml b/src/CoreShop/Bundle/ResourceBundle/Resources/config/services.yml index 967d352712..79d2d0a353 100755 --- a/src/CoreShop/Bundle/ResourceBundle/Resources/config/services.yml +++ b/src/CoreShop/Bundle/ResourceBundle/Resources/config/services.yml @@ -25,6 +25,11 @@ services: - { name: jms_serializer.handler, type: relation, direction: serialization, format: json, method: serializeRelation} - { name: jms_serializer.handler, type: relation, direction: deserialization, format: json, method: deserializeRelation} + coreshop.jms_serializer.handler.pimcore_object: + class: CoreShop\Bundle\ResourceBundle\Serialization\PimcoreObjectHandler + tags: + - { name: jms_serializer.handler, type: pimcoreObject, direction: serialization, format: json, method: serializeRelation} + jms_serializer.object_constructor: alias: jms_serializer.doctrine_object_constructor public: false diff --git a/src/CoreShop/Bundle/ResourceBundle/Serialization/PimcoreObjectHandler.php b/src/CoreShop/Bundle/ResourceBundle/Serialization/PimcoreObjectHandler.php new file mode 100644 index 0000000000..de865a6ad4 --- /dev/null +++ b/src/CoreShop/Bundle/ResourceBundle/Serialization/PimcoreObjectHandler.php @@ -0,0 +1,29 @@ +getId(); + } + + return null; + } +}