I have database table that looks like this:
+----+--------+--------------------+ | id | parent | description | +----+--------+--------------------+ | 1 |
To do this in YAML, the configuration would look something like:
AppBundle\Entity\Category:
type: entity
table: category
repositoryClass: AppBundle\Repository\CategoryRepository
id:
id:
type: integer
id: true
generator:
strategy: AUTO
oneToMany:
children:
targetEntity: Category
mappedBy: parent
manyToOne:
parent:
targetEntity: Category
inversedBy: children
Source: http://doctrine-orm.readthedocs.org/projects/doctrine-orm/en/latest/reference/association-mapping.html#one-to-many-self-referencing