Skip to content

Conversation

@cinamo
Copy link
Contributor

@cinamo cinamo commented Oct 26, 2021

Q A
Branch? 5.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets Fix #43753
License MIT

When loading a bundle with a Doctrine entity, this entity is automatically recognized if auto_mapping: true is set in the Doctrine DBAL configuration. This currently only works if your entity class uses annotations, not attributes; this pull request adds that possibility.

@carsonbot carsonbot added this to the 5.4 milestone Oct 26, 2021
@cinamo cinamo changed the title Determine attribute or annotation type for directories [DoctrineBridge] Determine attribute or annotation type for directories Oct 26, 2021
@derrabus
Copy link
Member

Can you add a test please?

@cinamo
Copy link
Contributor Author

cinamo commented Oct 26, 2021

Can you add a test please?

@derrabus I would love to. However, the original functionality doesn't have a test to begin with. Also, this test would necessarily need to refer to external files and I don't have any idea how to do that in your test suite. Can you give me a pointer how you would go about this?

@nicolas-grekas
Copy link
Member

nicolas-grekas commented Oct 28, 2021

Writing tests could be done by adding a directory with fixtures in a test folder.

@cinamo
Copy link
Contributor Author

cinamo commented Oct 31, 2021

Writing tests could be done by adding a directory with fixtures in a test folder.

Thanks for the suggestion, have made a new folder with an attribute annotation entity and added a test to detect the different kind of types.

@carsonbot carsonbot changed the title [DoctrineBridge] Determine attribute or annotation type for directories Determine attribute or annotation type for directories Nov 2, 2021
@carsonbot carsonbot changed the title Determine attribute or annotation type for directories [DoctrineBridge] Determine attribute or annotation type for directories Nov 2, 2021
@nicolas-grekas
Copy link
Member

Thank you @cinamo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DoctrineBridge] Attribute notation for entity in bundles is not recognized

4 participants