From 0b4969d107afb3fe0fa60f01b600c4301dd90a44 Mon Sep 17 00:00:00 2001 From: Dominik Pfaffenbauer Date: Thu, 14 Feb 2019 12:20:41 +0100 Subject: [PATCH] [ResourceBundle] add serialization for pimcore types --- .../Resources/config/services.yml | 17 ++++++++++- .../Serialization/PimcoreAssetHandler.php | 29 +++++++++++++++++++ .../Serialization/PimcoreDocumentHandler.php | 29 +++++++++++++++++++ .../Serialization/PimcoreSiteHandler.php | 29 +++++++++++++++++++ 4 files changed, 103 insertions(+), 1 deletion(-) create mode 100644 src/CoreShop/Bundle/ResourceBundle/Serialization/PimcoreAssetHandler.php create mode 100644 src/CoreShop/Bundle/ResourceBundle/Serialization/PimcoreDocumentHandler.php create mode 100644 src/CoreShop/Bundle/ResourceBundle/Serialization/PimcoreSiteHandler.php diff --git a/src/CoreShop/Bundle/ResourceBundle/Resources/config/services.yml b/src/CoreShop/Bundle/ResourceBundle/Resources/config/services.yml index 79d2d0a353..d0682f5360 100755 --- a/src/CoreShop/Bundle/ResourceBundle/Resources/config/services.yml +++ b/src/CoreShop/Bundle/ResourceBundle/Resources/config/services.yml @@ -30,6 +30,21 @@ services: tags: - { name: jms_serializer.handler, type: pimcoreObject, direction: serialization, format: json, method: serializeRelation} + coreshop.jms_serializer.handler.pimcore_document: + class: CoreShop\Bundle\ResourceBundle\Serialization\PimcoreDocumentHandler + tags: + - { name: jms_serializer.handler, type: pimcoreDocument, direction: serialization, format: json, method: serializeRelation} + + coreshop.jms_serializer.handler.pimcore_asset: + class: CoreShop\Bundle\ResourceBundle\Serialization\PimcoreAssetHandler + tags: + - { name: jms_serializer.handler, type: pimcoreAsset, direction: serialization, format: json, method: serializeRelation} + + coreshop.jms_serializer.handler.pimcore_site: + class: CoreShop\Bundle\ResourceBundle\Serialization\PimcoreSiteHandler + tags: + - { name: jms_serializer.handler, type: pimcoreSite, direction: serialization, format: json, method: serializeRelation} + jms_serializer.object_constructor: alias: jms_serializer.doctrine_object_constructor public: false @@ -53,4 +68,4 @@ services: coreshop.doctrine.cache.pimcore: class: CoreShop\Component\Resource\Doctrine\Cache\PimcoreCache arguments: - - '@Pimcore\Cache\Core\CoreHandlerInterface' \ No newline at end of file + - '@Pimcore\Cache\Core\CoreHandlerInterface' diff --git a/src/CoreShop/Bundle/ResourceBundle/Serialization/PimcoreAssetHandler.php b/src/CoreShop/Bundle/ResourceBundle/Serialization/PimcoreAssetHandler.php new file mode 100644 index 0000000000..70a7e47c0d --- /dev/null +++ b/src/CoreShop/Bundle/ResourceBundle/Serialization/PimcoreAssetHandler.php @@ -0,0 +1,29 @@ +getId(); + } + + return null; + } +} diff --git a/src/CoreShop/Bundle/ResourceBundle/Serialization/PimcoreDocumentHandler.php b/src/CoreShop/Bundle/ResourceBundle/Serialization/PimcoreDocumentHandler.php new file mode 100644 index 0000000000..c7a4dd2434 --- /dev/null +++ b/src/CoreShop/Bundle/ResourceBundle/Serialization/PimcoreDocumentHandler.php @@ -0,0 +1,29 @@ +getId(); + } + + return null; + } +} diff --git a/src/CoreShop/Bundle/ResourceBundle/Serialization/PimcoreSiteHandler.php b/src/CoreShop/Bundle/ResourceBundle/Serialization/PimcoreSiteHandler.php new file mode 100644 index 0000000000..ad4fdfdbc2 --- /dev/null +++ b/src/CoreShop/Bundle/ResourceBundle/Serialization/PimcoreSiteHandler.php @@ -0,0 +1,29 @@ +getId(); + } + + return null; + } +}