mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
[PR #418] [CLOSED] Add ODM embedded-like functionality #8165
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/doctrine/orm/pull/418
Author: @djlambert
Created: 8/6/2012
Status: ❌ Closed
Base:
master← Head:MappedAssociation2📝 Commits (10+)
ab24670New MappedAssociation annotation.24e4676Include MappedAssociation annotation.4618712Annotation driver support for MappedAssocation annotation.b01a183Added array to hold mapped associations.cb85c03Include mapped associations in sleep and reflection wakeup.6427bf6Added method addMappedAssociation to validate and add mapped association to class.090f206Added mapped association exceptions.96d3f39Added utility functions to check if class has mapped associations and getter.d6a600dWhitespace.7fedd86Added method addMappedAssociationDiscriminatorColumnDefinitions to add mapped association descriminator columns to the table.📊 Changes
21 files changed (+954 additions, -24 deletions)
View changed files
📝
lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php(+3 -1)📝
lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php(+88 -0)📝
lib/Doctrine/ORM/Mapping/DefaultQuoteStrategy.php(+12 -2)📝
lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php(+12 -0)📝
lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php(+1 -0)➕
lib/Doctrine/ORM/Mapping/MappedAssociation.php(+36 -0)📝
lib/Doctrine/ORM/Mapping/MappingException.php(+22 -0)📝
lib/Doctrine/ORM/Mapping/QuoteStrategy.php(+12 -1)📝
lib/Doctrine/ORM/Persisters/BasicEntityPersister.php(+73 -14)📝
lib/Doctrine/ORM/Tools/SchemaTool.php(+34 -3)📝
lib/Doctrine/ORM/UnitOfWork.php(+12 -3)➕
tests/Doctrine/Tests/Models/MappedAssociation/DiscretePrimary/AbstractObject.php(+71 -0)➕
tests/Doctrine/Tests/Models/MappedAssociation/DiscretePrimary/Book.php(+11 -0)➕
tests/Doctrine/Tests/Models/MappedAssociation/DiscretePrimary/Shelf.php(+93 -0)➕
tests/Doctrine/Tests/Models/MappedAssociation/DiscretePrimary/Video.php(+11 -0)➕
tests/Doctrine/Tests/Models/MappedAssociation/PrimaryIsForeign/AbstractContent.php(+55 -0)➕
tests/Doctrine/Tests/Models/MappedAssociation/PrimaryIsForeign/FileFolder.php(+93 -0)➕
tests/Doctrine/Tests/Models/MappedAssociation/PrimaryIsForeign/Paper.php(+11 -0)➕
tests/Doctrine/Tests/Models/MappedAssociation/PrimaryIsForeign/Photo.php(+11 -0)➕
tests/Doctrine/Tests/ORM/Functional/MappedAssociationTest.php(+274 -0)...and 1 more files
📄 Description
This PR adds ODM embedded-like functionality to the ORM.
Including the new @MappedAssociation annotation on a field having a one-to-one association adds a discriminator column to the table for storing the class name of a "mapped" entity.
This allows a class or mapped superclass with ID and association to be extended by additional entities without requiring any code changes (as is required when using inheritance).
I apologize if this is the incorrect way to submit a feature request. Currently just the annotation driver has been updated, I wanted to get feedback before continuing with the remaining drivers. Models and tests are included, and all the existing tests continue to pass (the ones that weren't skipped anyways).
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.