Modeling with Doctrine In this post, we try to use Doctrine to make the models richer, and make it more like a real world application. Overview Imagine there are several models in this application, Album , Artist , Song , Person . An Artist could compose many Album s. An Album could be accomplished by more than one Artist . An Album includes several Song s. An Artist is a generalized Person . In Doctrine ORM, it is easy to describe the relation between models. Album and Artist is a ManyToMany relation. Album and Song is a OneToMany relation. Artist is inherited from Person . Codes of Models The code of Album class. /** * @ORM\Entity */ class Album { /** * @ORM\Id * @ORM\GeneratedValue(strategy="AUTO") * @ORM\Column(...