Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Don't generate proxy classes for embedded documents #1628

Merged
merged 1 commit into from
Aug 15, 2017

Conversation

alcaeus
Copy link
Member

@alcaeus alcaeus commented Aug 11, 2017

Fixes #1627.

Not sure about tests here, but it fixes the issue.

@alcaeus alcaeus added this to the 1.1.6 milestone Aug 11, 2017
@alcaeus alcaeus self-assigned this Aug 11, 2017
@alcaeus alcaeus requested a review from malarzm August 11, 2017 13:14
@@ -62,7 +63,9 @@ protected function execute(Console\Input\InputInterface $input, Console\Output\O
{
$dm = $this->getHelper('documentManager')->getDocumentManager();

$metadatas = $dm->getMetadataFactory()->getAllMetadata();
$metadatas = array_filter($dm->getMetadataFactory()->getAllMetadata(), function (ClassMetadata $classMetadata) {
return !$classMetadata->isEmbeddedDocument;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should also exclude $classMetadata->isQueryResultDocument while we're here (and maybe $classMetadata->isMappedSuperclass too)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll just change the check to isDocument, that's simpler. I'll have to think about isQueryResultDocument - there may be the need for proxies there.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated. Turns out we don't have isDocument, so I can't test against that. We also don't need to generate proxies for query result documents, so I'll add that when merging down to master. 👍

@malarzm
Copy link
Member

malarzm commented Aug 11, 2017

Not sure about tests here, but it fixes the issue.

I wouldn't worry too much here, it's only commands ;)

@alcaeus alcaeus force-pushed the no-proxy-embedded-documents branch from fd6112f to 7e96bba Compare August 13, 2017 08:48
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Don't generate proxy classes for embedded documents
3 participants