title: Composite foreign key in Doctrine
body: <p>I'm not really sure I'm using the good terms, so I'll try to explain my problem first.</p>
  
  <p>I have a cross-reference table, <code>CompetenceCollab</code>, containing the associations between people and their competences. This table has two primary keys, the people's id, and the competence's id. To this point, everything is ok.</p>
  
  <p>However, the new feature I have to add is the following one : people must be able to add a rating to other people's competences. Basically, this means I have to add a new table, which will contain the note, who gave it, and somehow a link to the <code>CompetenceCollab</code> table. One colleague told me I can use what he called an "alternate key", defining two foreign keys, one for each primary column of <code>CompetenceCollab</code>, and telling somehow the database that each rating is associated with a competence and a people.</p>
  
  <p>So my questions are the following :</p>
  
  <ul>
  <li>first of all, do this design seems completely mad, and if it is the case, how should I do ?</li>
  <li>I have to use Doctrine ORM in Symfony. Is this kind of thing possible using that ? If yes, could someone provide me a way of how to define it in the YAML file ?</li>
  </ul>
  
  <p>Thanks for the help, feel free to ask questions in the comments, I don't know if I was really that clear.</p>