symfony 2.7.13 JMS Serializer customization of 3rd-party bundles query problems

流过昼夜 提交于 2020-01-02 10:35:21

问题


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 ?

来源:https://stackoverflow.com/questions/37629578/symfony-2-7-13-jms-serializer-customization-of-3rd-party-bundles-query-problems

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!