Skip to content

Use of ObjectManager->getClassMetadata on the className in ReferenceRepository methods breaks expected behaviour #426

@hitsuji

Description

@hitsuji

Symfony Documentation suggests Fixtures can share any PHP object between each other using the addReference and getReference methods. https://symfony.com/bundles/DoctrineFixturesBundle/current/index.html#sharing-objects-between-fixtures

However,
tracing through these calls through to the ReferenceRepository, both will eventually call ObjectManager->getClassMetadata which will require the classes namespace to be configure in the ORM EntityManager, otherwise throwing an error.

So attempting to store an stdClass will throw an error similar to: The class 'stdClass' was not found in the chain configured namespaces App\Entity.

Either Documentation needs to be corrected or the behavior needs to be corrected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions