mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
[PR #419] [CLOSED] Add ODM embedded-like functionality #8163
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/419
Author: @djlambert
Created: 8/7/2012
Status: ❌ Closed
Base:
master← Head:MappedAssociation3📝 Commits (10+)
9d487c7New MappedAssociation annotation.0e55b8aAnnotation driver support for MappedAssocation annotation.8be7fd9Added array to hold mapped associations.34925e9Include mapped associations in sleep and reflection wakeup.b5032bdAdded method addMappedAssociation to validate and add mapped association to class.ca160d9Added mapped association exceptions.b165068Added utility functions to check if class has mapped associations and getter.457c439Added method addMappedAssociationDiscriminatorColumnDefinitions to add mapped association descriminator columns to the table.f15895cAdd mapped association discriminator columns to the schema.be0c83bInclude mapped association in change detection.📊 Changes
17 files changed (+610 additions, -22 deletions)
View changed files
📝
lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php(+3 -1)📝
lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php(+74 -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(+69 -14)📝
lib/Doctrine/ORM/Tools/SchemaTool.php(+24 -1)📝
lib/Doctrine/ORM/UnitOfWork.php(+12 -3)➕
tests/Doctrine/Tests/Models/MappedAssociation/AbstractContent.php(+56 -0)➕
tests/Doctrine/Tests/Models/MappedAssociation/FileFolder.php(+93 -0)➕
tests/Doctrine/Tests/Models/MappedAssociation/Paper.php(+11 -0)➕
tests/Doctrine/Tests/Models/MappedAssociation/Photo.php(+11 -0)➕
tests/Doctrine/Tests/ORM/Functional/MappedAssociationTest.php(+150 -0)📝
tests/Doctrine/Tests/OrmFunctionalTestCase.php(+12 -0)📄 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 a one-to-one identifying association to be extended by additional entities without requiring any code changes (as is required with the discriminator map 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.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.