mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
OneToOne: Support for polymorphic associations #5332
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 @ihorsamusenko on GitHub (Nov 20, 2016).
Case:
I have plenty of entities in the system. I also have
entity_aliastable which consist of two fields: alias (pk), entity_id. (NOTE: in my database all the entities have a unique id across the whole database, that is why I do not have entity_type field inentity_aliastable).Goal:
Create a trait which can be used to any entity and which provides an ability to set, get and drop alias for an entity.
Code example:
Alias entity:
AliasableTrait:
Right now I am getting Missing value for primary key alias on Alias.
Question:
Is it possible to do?
@malutanpetronel commented on GitHub (May 11, 2023):
did you manage to make it work ?