Doctrine 2 Object Relational Mapper (ORM)
2ead9e23ab
Without this patch, when an entity that refers multiple times to the same associated entity gets merged, the second references becomes null. The main issue is that even though doMerge returns a managed copy, that value is not used while cascading the merge. These identicial entities are already detected through the visitor map, but they are ignored. There should be some refactoring so cascadeMerge calls a function that checks if the parent must be updated, based on the return value of its call to doMerge. However, this patch tries to impact the code as little as possible, and only introduces a new function to avoid duplicate code. The secondary issue arises when using inverted associations. In that case, it is possible that an entity to be merged is already merged, so the the visitor map is looked up by the hash of a managed copy instead of the original entity. This means that in this case the visitor map entries should also be set to the entity, instead of being set to 'true'. |
||
---|---|---|
bin | ||
docs | ||
lib | ||
tests | ||
tools/sandbox | ||
.coveralls.yml | ||
.gitattributes | ||
.gitignore | ||
.gitmodules | ||
.travis.yml | ||
build.properties | ||
build.properties.dev | ||
build.xml | ||
composer.json | ||
CONTRIBUTING.md | ||
doctrine-mapping.xsd | ||
LICENSE | ||
phpunit.xml.dist | ||
README.markdown | ||
run-all.sh | ||
SECURITY.md | ||
UPGRADE.md |
Doctrine 2 ORM
Doctrine 2 is an object-relational mapper (ORM) for PHP 5.3.2+ that provides transparent persistence for PHP objects. It sits on top of a powerful database abstraction layer (DBAL). One of its key features is the option to write database queries in a proprietary object oriented SQL dialect called Doctrine Query Language (DQL), inspired by Hibernates HQL. This provides developers with a powerful alternative to SQL that maintains flexibility without requiring unnecessary code duplication.