title: Using doctrine findBy method
body: <p>I am working on blog project where is lots of posts from different authors and i want to create a simple filter that would return me only posts by given author:</p>
  
  <p>This is my controller that takes data from user:</p>
  
  <pre><code>    /**
       * @Route("/author/{author}", name="post_author")
       * @Template()
       */
      public function findByAuthorAction($author)
      {
  
      $criteria = /*this is what i need*/
      $posts=$this-&gt;get('cvut_fit_biwt1_blog')-&gt;findPostBy($criteria);
  
      return array(
          'posts'=&gt;$posts
      );
  }
  </code></pre>
  
  <p>This is how findPostBy looks like:</p>
  
  <pre><code>public function findPostBy(array $criteria)
      {
          return $this-&gt;postRepository-&gt;findBy($criteria);
      }
  </code></pre>
  
  <p>And finally implementation of findBy in Doctrine EntityRepository:</p>
  
  <pre><code> public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
      {
          $persister = $this-&gt;_em-&gt;getUnitOfWork()-&gt;getEntityPersister($this-&gt;_entityName);
  
          return $persister-&gt;loadAll($criteria, $orderBy, $limit, $offset);
      }
  </code></pre>
  
  <p>Can you tell me how to build criteria array in my contoller so it would filter my posts (if it is even possible) ?</p>