symfony 2.7.13 JMS Serializer customization of 3rd

2019-05-23 14:16发布

I try to customize my jms serializer config and copy the xml config of SonataMediaBundle to my local config.

The requests are in a Controller that extends FOSRestBundle in a Symfony 2.7.13 application with sonata-project bundles.

My current issue is, that I have a very long execution time due to a pool of thousands queries.

If I use the default serializer config of the sonataMediaBundle I only have one query.

config.yml:

jms_serializer:
metadata:
    auto_detection: false
    directories:
        FOSUB:
            namespace_prefix: "FOS\\UserBundle"
            path: "%kernel.root_dir%/serializer/FOSUB"
        SonataMediaBundle:
          namespace_prefix: "Sonata\\MediaBundle"
          path: "%kernel.root_dir%/Resources/config/serializer/SonataMediaBundle"

Does anyone of you have got the same problem?

Is it possible to deactivate the default serialization of SonataMediaBundle to use only annotations in my entities ?

0条回答
登录 后发表回答