Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Override bundle entity mapping #7076

Closed
Closed
Labels
DoctrineactionableClear and specific issues ready for anyone to take them.hasPRA Pull Request has already been submitted for this issue.
@psrpinto

Description

@psrpinto

In theEntities & Entity Mapping section ofHow to Override any Part of a Bundle, the following is stated:

Due to the way Doctrine works, it is not possible to override entity mapping of a bundle. However, if a bundle provides a mapped superclass (such as the User entity in the FOSUserBundle) one can override attributes and associations.

I believe this is not completely true. If the bundle is defining the mapping in configuration files, it is possible to override the files, and thus the mapping. There is one caveat though: all mapping configuration files of the bundle must be overridden, you can't override just one of them.

I just tried it withJMSPaymentCoreBundle and it does work. I copied all the mapping files intoapp/Resources/config/JMSPaymentCoreBundle and then set the following configuration:

# app/config/config.ymlorm:auto_generate_proxy_classes:"%kernel.debug%"naming_strategy:doctrine.orm.naming_strategy.underscoreauto_mapping:truemappings:JMSPaymentCoreBundle:mapping:truetype:xmldir:'%kernel.root_dir%/../app/Resources/config/JMSPaymentCoreBundle'alias:'JMSPaymentCoreBundle'prefix:'JMS\Payment\CoreBundle\Entity'

If I then alter something in one of the mapping files and runbin/console doctrine:schema:update, I can see my changes are there.

Would it be useful to clarify this in the docs?

Metadata

Metadata

Assignees

No one assigned

    Labels

    DoctrineactionableClear and specific issues ready for anyone to take them.hasPRA Pull Request has already been submitted for this issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp