I have an Author object, which is a class table inheritance containing AuthorUser and AuthorGroup .
/** * Author * * @ORM\Table * @ORM\Entity * @ORM\InheritanceType("JOINED") * @ORM\DiscriminatorColumn(name="type", type="string") * @ORM\DiscriminatorMap({"user" = "AuthorUser", "group" = "AuthorGroup"}) */ class Author { // ... }
AuthorUser refers to my User object and AuthorGroup to my Group object.
class AuthorUser extends Author { protected $user; } class AuthorGroup extends Author { protected $user; }
I have no idea how to do this. Anyway, the problem is that I have to add this CTI to my Article object field. How can I associate the use of ManyToOne with this field of an Article object?
class Article { protected $author; }
I'm not sure how to make this as transparent as possible. When I create a new Article , I need to provide a User or Group object in the Author field. I followed this behavior, but it doesn't seem to help. It gets even harder.
source share