title: Not able to cache the entity object in Doctrine using Zend framework 2
body: <p>I tried caching the Doctrine entity object using zend cache service.
  It works fine if the entity object does not have any foreign key reference but fails when the
  entity object has a foreign key reference and points to an entity belonging to different namespace.</p>
  
  <p>It was throwing this error -
  The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition DoctrineORMModule\Proxy__CG__\Attachment\Entity\Attachment of the object you are trying to operate on was loaded <em>before</em> unserialize() gets called or provide a __autoload() function to load the class definition in /home/vaishnavi/NetBeansProjects/testsuite/module/Test/view/test/test/view-test-case.phtml </p>
  
  <p>Fixed the above error by autoloading the proxy classes in init_autoloader.php by providing this -</p>
  
  <pre><code>use Doctrine\ORM\Proxy\Autoloader;
  
  $proxyDir = __DIR__."/data/DoctrineORMModule/Proxy";
  $proxyNamespace = "DoctrineORMModule\Proxy";
  Autoloader::register($proxyDir, $proxyNamespace);
  </code></pre>
  
  <p>Now the above error does not come but does not display the property values of foreign key reference class. Can somebody help?</p>