title: Doctrine2 ORM - Error using getResult
body: <p>I am using DoctrineORM and its querybuilder to update some data in my mySQL database. Look at my code below, I cannot spot the mistake.</p>
  <pre><code>public function update($id, Request $request){
  
      $em = new em();
      // fetch the document to be updated
      $updatedDocument = $em-&gt;getEm()-&gt;find('backend\resources\entities\Document', $id);
      $document = $request-&gt;request-&gt;all();
  
      $translator = new Translator('de_de');
      $validator = new Validation\Validator($translator, $document, $this-&gt;rules);
  
      if($validator-&gt;passes()){
          $updatedDocument-&gt;setTitle($document['title']);
          $updatedDocument-&gt;setWorkflow($document['workflow']);
          $updatedDocument-&gt;setDocClass($document['docClass']);
  
          $em-&gt;getEm()-&gt;persist($document);
          $em-&gt;getEm()-&gt;flush();
  
          $response = json_encode($document);
          return new Response($response, 200, array('Content-Type' =&gt; 'json'));
      }
  
      $response = json_encode(array('Error' =&gt; 'Could not be updated.'));
      return new Response($response, 200, array('Content-Type' =&gt; 'json'));
  
  }
  </code></pre>
  <p>Now when I try to call this function I get this message:</p>
  <blockquote>
  <p>Warning: require(/tmp/__CG__backendresourcesentitiesUser.php): failed to open stream: No such file or directory in /www/htdocs/w00ebb23/fokus/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php on line 207</p>
  <p>Fatal error: require(): Failed opening required '/tmp/__CG__backendresourcesentitiesUser.php' (include_path='.:/usr/share/php:..') in /www/htdocs/w00ebb23/fokus/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php on line 207</p>
  </blockquote>
  <p>I have to add that function with nearly the same content but for different entities work well. But this one doesn't.
  A simple find by Id works fine when I use getArrayResult instead of getResult or getSingleResult. Any ideas what could be the error?</p>