title: Specifying relationships with YAML for Doctrine
body: <p>Just trying to specify some tables structures and models for Doctrine in a YAML file. I'm going through the documentation on this page: <a href="http://www.doctrine-project.org/projects/orm/1.2/docs/manual/yaml-schema-files/en" rel="nofollow">http://www.doctrine-project.org/projects/orm/1.2/docs/manual/yaml-schema-files/en</a></p>
  
  <p>I haven't quite got a grasp on what each line in the <strong>relations</strong> section is doing.</p>
  
  <p>Here's some sample YAML from that page:</p>
  
  <pre>
  User:
      columns:
      username:
        type: string(255)
      password:
        type: string(255)
      contact_id:
        type: integer
    relations:
      Contact:
        class: Contact
        local: contact_id
        foreign: id
        foreignAlias: User
        foreignType: one
        type: one
  </pre>
  
  <p>Specifically, <strong>relations</strong>, in order:</p>
  
  <p><strong>Contact</strong> is.. I am guessing the name of the other corresponding table pertaining to this relationship?</p>
  
  <p><strong>class: contact</strong> is.. what exactly? The name of the model that will be created from this YAML?</p>
  
  <p><strong>local: contact_id</strong> is the local key, I understand this.</p>
  
  <p><strong>foreign: id</strong> is the field name of the foreign key, I understand this</p>
  
  <p><strong>foreignAlias: User</strong> what is this line doing?</p>
  
  <p><strong>foreignType: one</strong><br>
  <strong>type: one:</strong> I am guessing these two lines together specify the type of relationship, eg, one-to-one?</p>
  
  <p>Thanks for any and all help.</p>