Skip to content

Conversation

@yuriy-yakubskiy
Copy link

@yuriy-yakubskiy yuriy-yakubskiy commented Oct 28, 2018

Hey guys,

The following could fix an issue without adding extra config to maker.

Symfony Version: 3.4
Maker Bundle: 1.8.0 and master
Bug Fix: #265, #299

P.S

  1. Failed to find the way to add a test for Symfony 3.4 only 4+ tests are supported currently

  2. Unfortunately can't fix as proposed in the following comment
    "make:entity" root directory location improvment #265 (comment)
    if call $cmf->getAllMetadata() before generate entity it couldn't be loaded by calling getAllMetadata again.
    See the following commit in other branch yuriy-yakubskiy@8b66999

Thanks!

@yuriy-yakubskiy yuriy-yakubskiy force-pushed the make_entity_no_directory_fix_master branch from 01b159f to 385c0f7 Compare October 28, 2018 12:24
@yuriy-yakubskiy yuriy-yakubskiy changed the title Fixed issue with no entity in directory for symfony 3.4 Fixed issue with no entity directory in symfony 3.4 Oct 28, 2018
@yuriy-yakubskiy yuriy-yakubskiy force-pushed the make_entity_no_directory_fix_master branch from 385c0f7 to fa4f97d Compare October 29, 2018 07:04
@weaverryan
Copy link
Member

Hey @yuriy-yakubskiy!

Thanks for taking this on! There is now a "competing" PR - #311. That approach looks good to me... however, the tests are failing. And I'm wondering you "hit" the same issue that the tests are hitting in #311. Specifically, can you explain your comment a bit more:

Unfortunately can't fix as proposed in the following comment #265 (comment)
if call $cmf->getAllMetadata() before generate entity it couldn't be loaded by calling getAllMetadata again.
See the following commit in other branch yuriy-yakubskiy/maker-bundle@8b66999

Thanks!

@yuriy-yakubskiy
Copy link
Author

Hey @weaverryan !

The main problem is that if use DoctrineHelper for auto-completing entity names it loads doctrine metadata

$loaded = $cmf->getAllMetadata();

before generate an entity class. Then after entity is generated application checks if class exists here

$classExists = class_exists($entityClassDetails->getFullName());

but as metadata was loaded without this class it returns false and application and test accordingly fails on this stage.
I tried but failed to find a way to let know the auto-loader that there is a new generated entity class...

Hope it explains more or less the issue.

Cheers

weaverryan added a commit that referenced this pull request Dec 20, 2018
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
@weaverryan
Copy link
Member

Merged #311 - thanks for starting this!

@weaverryan weaverryan closed this Dec 20, 2018
saylor-mik87786 added a commit to saylor-mik87786/maker-bundle that referenced this pull request Jun 3, 2025
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
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