down vote | You can see in this link to know about inheritance: http://docs.doctrine-project.org/en/latest/reference/inheritance-mapping.html#single-table-inheritance You must declare in UserBundle\Entity\User: And BlogBundle\Entity\User Goodluck! |
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
http://stackoverflow.com/questions/5823905/how-to-manage-single-table-inheritance-within-doctrine-2
--------------------------------------------------------
Based on the example from the docs:
/**
* @Entity
* @InheritanceType("SINGLE_TABLE")
* @DiscriminatorColumn(name="resource_type", type="string")
* @DiscriminatorMap({"article_vote" = "ArticleVote", "comment_vote" = "CommentVote"})
*/
class Vote
{
private $id;
private $weight;
}
class ArticleVote extends Vote
{
/** @ManyToOne(...) */
private $article;
}
class CommentVote extends Vote
{
/** @ManyToOne(...) */
private $comment;
}
answered Apr 29 '11 at 3:53 |
Just incase someone else needs it, here is an detailed example in using Table Inheritance with Doctrine. I found it more informative than the Doctrine documentation:
http://blog.liip.ch/archive/2012/03/27/table-inheritance-with-doctrine.html