-
-
Notifications
You must be signed in to change notification settings - Fork 424
"make:entity" root directory location improvment #265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
… the "make:entity" command
The error returned by the AppVeyor build seems not to be dued to my development : Error: "PHP Fatal error: Uncaught Symfony\Component\Debug\Exception\ClassNotFoundException: Attempted to load class "Kernel" from namespace "Custom" |
Hey @bastos71! Ah, I think I understand the issue: it's just that the auto-complete questions don't fill from the correct entity directory - that part IS indeed hardcoded. But, I think there's a better solution - and I think you already saw the PR I'm talking about :) #185 (comment) As I mentioned there, there's no reason to force the user to think/configure an option at all. We can ask Doctrine for the list of mapped entity and create an auto-complete list from that. In fact, I think we may already have the hard part done :) - see: maker-bundle/src/Doctrine/DoctrineHelper.php Lines 101 to 116 in 24ae473
This code was created after MakeEntity I believe, so we may just be able to point to that and fix it. Would you be willing to try it? |
Thanks for your reply @weaverryan But what if the user tries to create its very First Entity ? That means there would not have any mapped entities, so no namespace to list :/ |
This PR was squashed before being merged into the 1.0-dev branch (closes #311). Discussion ---------- Fix Entity directory does not exist Closes #299 according to #185 (comment) Also alternative for #185, #265 and #310 Commits ------- 5f37c5d Remove invalid field mapping 06f5399 Invalidating cached AnnotationDriver::$classNames to find new entities 8b7c291 Fix 'src/Entity' directory does not exist
This PR was squashed before being merged into the 1.0-dev branch (closes #311). Discussion ---------- Fix Entity directory does not exist Closes #299 according to symfony/maker-bundle#185 (comment) Also alternative for symfony/maker-bundle#185, symfony/maker-bundle#265 and symfony/maker-bundle#310 Commits ------- 5f37c5d Remove invalid field mapping 06f5399 Invalidating cached AnnotationDriver::$classNames to find new entities 8b7c291 Fix 'src/Entity' directory does not exist
As a developer using Symfony 3.x, I got issues using
make:entity
I made this pull request to allow users to override the hardcoded
src/Entity/
as the root directory for entities.Now there are two ways to override it :
config.yml
make:entity
command :Anyway the file will be created to the correct location (corresponding to the class namespace), that was already the case before my pull request.