Skip to content

Conversation

@antalaron
Copy link
Contributor

As in #322 the entity maker cannot make a relation, where the target entity is also presented in the root namespace, beacuse Symfony\Bundle\MakerBundle\Maker\MakeEntity::askRelationDetails() looks for it in the root namespace at first.

I don't think this is the good behaviour.

This PR makes it look for first in the namepace defined in the config, and after that in other places.

@antalaron
Copy link
Contributor Author

I don't know if the tests is enought, I've only created one for a self-referencing ManyToOne

@antalaron antalaron changed the title Issue 322 Look for the target entity in the namespace first Feb 4, 2019
@weaverryan
Copy link
Member

Thank you Antal - excellent job fixing this!

@weaverryan weaverryan merged commit 1003c21 into symfony:master Mar 1, 2019
weaverryan added a commit that referenced this pull request Mar 1, 2019
This PR was squashed before being merged into the 1.0-dev branch (closes #360).

Discussion
----------

Look for the target entity in the namespace first

As in #322 the entity maker cannot make a relation, where the target entity is also presented in the root namespace, beacuse `Symfony\Bundle\MakerBundle\Maker\MakeEntity::askRelationDetails()` looks for it in the root namespace at first.

I don't think this is the good behaviour.

This PR makes it look for first in the namepace defined in the config, and after that in other places.

Commits
-------

1003c21 Swap target entity namespace search
7fb5a31 Reproduce the error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants