Skip to content
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

Revived #265: [WIP] Mapping support for Embeddables (VOs). #547

Closed
wants to merge 9 commits into from

Conversation

Burgov
Copy link
Contributor

@Burgov Burgov commented Jan 10, 2013

I decided to merge #265 onto master in order to revive the branch. We're going to be in desperate need for something similar to this soon.

However, I'm getting a lot of errors by PHPUnit, so I clearly missed something. Can anyone tell me what needs to happen to get this stable again?

guilhermeblanco and others added 4 commits January 20, 2012 00:17
Conflicts:
	doctrine-mapping.xsd
	lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php
	lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php
	lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php
	lib/Doctrine/ORM/Mapping/MappingException.php
	lib/Doctrine/ORM/Persisters/BasicEntityPersister.php
	lib/Doctrine/ORM/Persisters/JoinedSubclassPersister.php
	lib/Doctrine/ORM/Tools/SchemaTool.php
	tests/Doctrine/Tests/ORM/Mapping/AbstractMappingDriverTest.php
	tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.User.php
	tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.User.dcm.xml
	tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.ORM.Mapping.User.dcm.yml
@doctrinebot
Copy link

Hello,

thank you for positing this Pull Request. I have automatically opened an issue on our Jira Bug Tracker for you with the details of this Pull-Request. See the Link:

http://doctrine-project.org/jira/browse/DDC-2232

@@ -554,6 +578,6 @@ protected function getDriver()
*/
protected function isEntity(ClassMetadataInterface $class)
{
return isset($class->isMappedSuperclass) && $class->isMappedSuperclass === false;
return isset($class->isMappedSuperclass) && $class->isMappedSuperclass === false && isset($class->isEmbeddable) && $class->isEmbeddable;
Copy link
Member

Choose a reason for hiding this comment

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

This is wrong. Uou are sayign that a class is an entity only if it is embeddable. It does not make sense

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice catch! That solved a lot of the errors already

@Ocramius
Copy link
Member

@Burgov was this rebased?

private function gatherEmbeddedsSql($class, $table, $schema)
{
foreach ($class->embeddedMappings as $embeddedFieldMapping) {
\Doctrine\Common\Util\Debug::dump($embeddedFieldMapping, 6);
Copy link
Member

Choose a reason for hiding this comment

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

this statement must be removed

@Burgov
Copy link
Contributor Author

Burgov commented Jan 10, 2013

@Ocramius i merged the old branch onto master, instead of rebasing. I hope that's not too big of a problem? Otherwise is there a way to use the merge commit to rebase it?

@Ocramius
Copy link
Member

@Burgov well, you can rebase now then... That will already be quite a nightmare after so much time. You could probably squash the commits before doing that

@Burgov
Copy link
Contributor Author

Burgov commented Jan 10, 2013

@Ocramius i'm not sure I'm following you? This PR is up to date with master, but that's thanks to the merge commit rather than a rebase action. I'm not sure how I can rebase this without redoing what I've been doing all day :)

@Ocramius
Copy link
Member

@Burgov sorry, I guess I just need to regain some focus :) my bad

@Burgov
Copy link
Contributor Author

Burgov commented Jan 10, 2013

Just spent some more time trying to find out what is going wrong, but I just can't get the hang of it. My guess is that everything will be fixed when the test below will be fixed. However, after debugging and looking at the old PR's code, I cannot find out exactly where and how the embedded mapping is supposed to be added to the $fieldMapping property

$ phpunit --filter SchemaTool
PHPUnit 3.7.9 by Sebastian Bergmann.

Configuration read from /home/bart/workspace/doctrine2/phpunit.xml.dist

..SSSSSSSSSSSSSE..E

Time: 2 seconds, Memory: 25.25Mb

There were 2 errors:

1) Doctrine\Tests\ORM\Tools\SchemaToolTest::testAddUniqueIndexForUniqueFieldAnnocation
Undefined index: parents_father

/home/bart/workspace/doctrine2/lib/Doctrine/ORM/Mapping/DefaultQuoteStrategy.php:40
/home/bart/workspace/doctrine2/lib/Doctrine/ORM/Tools/SchemaTool.php:371
/home/bart/workspace/doctrine2/lib/Doctrine/ORM/Tools/SchemaTool.php:525
/home/bart/workspace/doctrine2/lib/Doctrine/ORM/Tools/SchemaTool.php:229
/home/bart/workspace/doctrine2/tests/Doctrine/Tests/ORM/Tools/SchemaToolTest.php:29

2) Doctrine\Tests\ORM\Tools\SchemaToolTest::testPostGenerateEvents
Undefined index: parents_father

/home/bart/workspace/doctrine2/lib/Doctrine/ORM/Mapping/DefaultQuoteStrategy.php:40
/home/bart/workspace/doctrine2/lib/Doctrine/ORM/Tools/SchemaTool.php:371
/home/bart/workspace/doctrine2/lib/Doctrine/ORM/Tools/SchemaTool.php:525
/home/bart/workspace/doctrine2/lib/Doctrine/ORM/Tools/SchemaTool.php:229
/home/bart/workspace/doctrine2/tests/Doctrine/Tests/ORM/Tools/SchemaToolTest.php:99

FAILURES!
Tests: 19, Assertions: 14, Errors: 2, Skipped: 13.
``

@mvrhov
Copy link

mvrhov commented Jan 11, 2013

@Burgov are by any chance failing a postgresql tests?

@Burgov
Copy link
Contributor Author

Burgov commented Jan 11, 2013

@mvrhov

$ phpunit | grep -i postgresql
$

it appears not to be the case

@mvrhov
Copy link

mvrhov commented Jan 11, 2013

@Burgov I might be barking up the wrong tree, but the above looks quite like doctrine/dbal#221, that's why I asked if the fail only on postgresql

@beberlei
Copy link
Member

@Burgov i have this feature on my todo list very high and work on it, probably for 2.5. I am not sure opening this pull request here makes sense just to have this open. We are aware of this feature request, but its the most complicated feature addition of all time.

@Burgov
Copy link
Contributor Author

Burgov commented Jan 14, 2013

@beberlei it's good to know you're working on it (I had no way of knowing that though). Is there some kind of roadmap or an publicly visible branch for this feature?

@Burgov Burgov closed this Jan 14, 2013
@jankramer
Copy link

Very interested in this feature as well; +1 for publicly visible branch as soon there is something to see/test :)

@marcospassos
Copy link

Killer feature. Looking forward for updates!

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.

10 participants