title: Doctrine2 mapping of association with properties
body: <p>How to effectively map the objectified(or nested) relationship for the following case.</p>
  
  <p><a href="http://i.imgur.com/yiCYh4i.png" rel="nofollow">http://i.imgur.com/yiCYh4i.png</a></p>
  
  <p>If i have a study program i want to have all the students following any course in a certain year without having to loop over all the students in study programs. Having entities:</p>
  
  <pre><code>Studyprograms
  
  Students
  
  Courses
  </code></pre>
  
  <p>And the relation entities:</p>
  
  <pre><code>StudyprogramsStudents
  
  StudyprogramsStudentsCourses
  </code></pre>
  
  <p>In this case it is important:</p>
  
  <pre><code>One student can have more study programs
  
  One student follows the studyStudentCourse in a certain year.
  
  Courses are not directly related to study programs neither to students; 
  </code></pre>
  
  <p>Thanks in advance.</p>