title: Doctrine2 large collections
body: <p>I have been playing with doctrine2 + ZF setup for the last couple of days. </p>
  
  <p>One of the things I still can't figure out is the large array collection assosicaitons. For example let's say we have an entity called Post and each post can have many comments. </p>
  
  <pre><code>&lt;?php
  /**
   * @Entity
  */
  class Post
  {
    /**
     * @OneToMany(targetEntity="Comment", mappedBy="post")
     */
     protected $comments;
  }
  ?&gt;
  </code></pre>
  
  <p>Now this will load all comments if I do</p>
  
  <pre><code>$post-&gt;comments
  </code></pre>
  
  <p>But what if there are, say 10000 comments for this particular post? Then all will be loaded which is not good. And as far as I know slice/pagination will not be available until doctrine 2.1.</p>
  
  <p>Can someone advice me how I can paginate comments? With DQL maybe? if DQL, where do you implement this?Do I create a getComments method in the Post entity and do the DQL there?</p>
  
  <p>Thanks
  Bill</p>