Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Full documentation on YAML mapping for Doctrine ORM?

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?

like image 469
Matt Huggins Avatar asked Dec 26 '10 06:12

Matt Huggins


2 Answers

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.

like image 152
dellsala Avatar answered Sep 22 '22 05:09

dellsala


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.

like image 22
Orhan Saglam Avatar answered Sep 19 '22 05:09

Orhan Saglam