Persisting the data In Doctrine1 we have a nice opportunity to define a model in an yml file called schema. Good news is we can still do it in Doctrine2. But there's a better way. What I really like about Doctrine2 is that we can persist object of any class by giving a mapping hints with annotations: use Doctrine\ORM\Mapping as ORM; /** * @ORM\Entity * @ORM\Table(name="articles") */ class Article