title: doctrine 2 returns errror 'proxy directory must be writable'
body: <p>i am using doctrine 2 with Zendframework 2</p>
  
  <p>i am trying to return an object but keep getting this error: </p>
  
  <blockquote>
    <p>Your proxy directory must be writable</p>
  </blockquote>
  
  <p>this is my query: </p>
  
  <pre><code>$this-&gt;getEntityManager()
                      -&gt;getRepository('Messages\Entity\Messages')
                      -&gt;findOneBy(array('id' =&gt; 6,
                                        'receiverId' =&gt; 16
                     ));
  </code></pre>
  
  <p>However, the same query return an array without any problems re: </p>
  
  <pre><code>$qb = $this-&gt;getEntityManager()-&gt;createQueryBuilder();
  
       $qb-&gt;select(array('u'))
          -&gt;from('Messages\Entity\Messages','u')
          -&gt;where('u.id = :id')  
          -&gt;andWhere('u.receiverUserId = :receiverId')    
          -&gt;setParameter('receiverId',16)    
          -&gt;setParameter('id',(int)6);
  
        $query = $qb-&gt;getQuery();
          return   $data = $query-&gt;getArrayResult(); 
  </code></pre>