mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
DDC-3440: <Inheritance SINGLE_TABLE> Entity merge not working with parent entity #4242
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?
Originally created by @doctrinebot on GitHub (Dec 8, 2014).
Originally assigned to: @Ocramius on GitHub.
Jira issue originally created by user briancvn:
I have problem when try to merge the ProfilePersonEntity, all the fields in ProfilePersonEntity was merged, but all another fields of parent class cannot.
I worked fine (wonderful) when i loaded with find(entity id), the DB data mapped 100% to the entity.
Please check the code below
ProfileEntity.php
/****
@Entity
@Table(name="PROFILE")
@InheritanceType("SINGLE_TABLE")
@DiscriminatorColumn(name="type", type="string")
@DiscriminatorMap({
})
*/
class ProfileEntity extends LockableEntity {
/****
*/
private $type;
/****
*/
private $name;
...
}
ProfilePersonEntity.php
/****
@Entity
*/
class ProfilePersonEntity extends ProfileEntity {
/****
*/
private $lastName;
...
}
LockableEntity.php
/*** @MappedSuperclass **/
class LockableEntity extends BaseEntity {
}
BaseEntity.php
/****
@MappedSuperclass
@HasLifecycleCallbacks
*/
class BaseEntity extends AbstractEntity {
/****
*/
private $id;
/****
*/
private $version;
...
}
...
$this->entityManager->merge($entity);
$this->entityManager->flush();
...
@doctrinebot commented on GitHub (Dec 8, 2014):
Comment created by @ocramius:
Cannot reproduce: missing reproducible test case.
@doctrinebot commented on GitHub (Dec 8, 2014):
Issue was closed with resolution "Cannot Reproduce"