8

The YAML mapping documentation for entities seems to be lacking. It doesn't explain what the different types, the different generator strategies, what mappedBy means, what types of cascade values are allowed, how to define a many-to-one relationship, and a whole lot more. Where can I find full documentation for this YAML file?

Matt Huggins
  • 81,398
  • 36
  • 149
  • 218

3 Answers3

4

Unfortunately, the yaml format documentation for doctrine 2 is pretty limited at the moment.

Right now, the best way to figure out the yaml format is to look at the yaml driver implemetation.

Doctrine\ORM\Mapping\Driver\YamlDriver

Read through the the implementation of the loadMetadataForClass method. That shows you what properties the driver is expecting where.

You can also look at the annotations documentation to supplement your understanding. Many of the documented field names and expected values are the same as the yaml format. For example: once you figure out @column corresponds to the fields element of the yaml format, the rest of the annotations documentation for that element lines up with the yaml format.

dellsala
  • 932
  • 1
  • 9
  • 16
2

You can have look at Doctrine\Orm\Mapping\ClassMetadataInfo class located at

path/to/doctrine/library/Orm/Mapping/ClassMetadataInfo.php

In this class you can find mostly what's possible. If you read the comments carefully it will give you a better idea.

BenV
  • 12,052
  • 13
  • 64
  • 92
Orhan Saglam
  • 429
  • 5
  • 15
0

The v1.2 manual is much more complete.

BenV
  • 12,052
  • 13
  • 64
  • 92