title: Need help understanding Doctrine many to many self referencing code
body: <p>i am having trouble deciphering this block of code from <a href="https://web.archive.org/web/20100515041827/http://www.doctrine-project.org:80/projects/orm/2.0/docs/reference/association-mapping/en#many-to-many,-self-referencing" rel="nofollow noreferrer">doctrine documentation</a></p>
  
  <pre><code>/** @Entity */
  class User
  {
      // ...
  
      /**
       * @ManyToMany(targetEntity="User", mappedBy="myFriends")
       */
      private $friendsWithMe;
  
      /**
       * @ManyToMany(targetEntity="User", inversedBy="friendsWithMe")
       * @JoinTable(name="friends",
       *      joinColumns={@JoinColumn(name="user_id", referencedColumnName="id")},
       *      inverseJoinColumns={@JoinColumn(name="friend_user_id", referencedColumnName="id")}
       *      )
       */
      private $myFriends;
  
      // ...
  }
  </code></pre>
  
  <p>below is how i decipher a one to many bidirectional relationship</p>
  
  <p><a href="https://i.stack.imgur.com/ed6bi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ed6bi.png" alt="alt text"></a><br>
  <sub>(source: <a href="http://29.media.tumblr.com/tumblr_l5uwg3VH171qbp1vqo1_r1_500.png" rel="nofollow noreferrer">tumblr.com</a>)</sub>  </p>
  
  <p>but if i use the same method, ... below is what i get</p>
  
  <p><a href="http://img514.imageshack.us/img514/2918/snagprogram0000.png" rel="nofollow noreferrer">alt text http://img514.imageshack.us/img514/2918/snagprogram0000.png</a></p>
  
  <h1>UPDATE</h1>
  
  <p>i shld clarify my question. basically, i dont understand how is the opposite of <code>myFriends</code>, <code>friendsWithMe</code>. how i shld make sense of this code and more importantly know how to code such relationships myself. </p>