title: Doctrine/Symfony - Multiple one-to-many relations on same Model
body: <p>Here is an extract of the schema I actually have</p>
  
  <pre><code>Software:
    columns:
      title:
        type: string(255)
      id_publisher:
        type: integer
      id_developper:
        type: integer
  
  Company:
    columns:
      name:
        type: string(255)
      nationality:
        type: string(255)
  </code></pre>
  
  <p>As you can see, my Software model has two external references: publisher and developper. My whish would like to create a one to many relation for each of these two references. Problem is they are both companies. </p>
  
  <p>I first tried something like shown below on my Software model, but the relation works only for the first local reference id_publisher.</p>
  
  <pre><code>relations:
    Company:
      type: one
      foreignType: many
      local: [id_publisher, id_developper]
      foreign: id
  </code></pre>
  
  <p>Then I tried that (always on the Software Model):</p>
  
  <pre><code>relations:
    Publisher:
      class: Company
      type: one
      foreignType: many
      local: id_publisher
      foreign: id
    Developper:
      class: Company
      type: one
      foreignType: many
      local: id_developper
      foreign: id
  </code></pre>
  
  <p>But when I execute a query which count the number of soft linked to a company... </p>
  
  <pre><code>public function findAllQuery(Doctrine_Query $q = null) {
      $q = Doctrine_Query::create()
                      -&gt;select('c.*, COUNT(s.id) AS count_software')
                      -&gt;from('Company c')
                      -&gt;leftJoin('c.Software s')
                      -&gt;groupBy('c.id');
  
      return $q;
  }
  </code></pre>
  
  <p>...only publishers are take into account in the COUNT clause.</p>
  
  <p>So finally, my question is, how to deal with multiple one-to-many relations of a same model ??
  Thanks for your time !</p>