/**
  * Compiles the Doctrine proxy class code using the Doctrine ProxyFactory.
  *
  * @return void
  */
 public function compileProxies()
 {
     Files::emptyDirectoryRecursively(Files::concatenatePaths(array($this->environment->getPathToTemporaryDirectory(), 'Doctrine/Proxies')));
     /** @var \Doctrine\ORM\Proxy\ProxyFactory $proxyFactory */
     $proxyFactory = $this->entityManager->getProxyFactory();
     $proxyFactory->generateProxyClasses($this->entityManager->getMetadataFactory()->getAllMetadata());
 }
 /**
  * Called from functional tests, creates/updates database tables and compiles proxies.
  *
  * @return boolean
  */
 public function compile()
 {
     // "driver" is used only for Doctrine, thus we (mis-)use it here
     // additionally, when no path is set, skip this step, assuming no DB is needed
     if ($this->settings['backendOptions']['driver'] !== null && $this->settings['backendOptions']['path'] !== null) {
         $schemaTool = new SchemaTool($this->entityManager);
         if ($this->settings['backendOptions']['driver'] === 'pdo_sqlite') {
             $schemaTool->createSchema($this->entityManager->getMetadataFactory()->getAllMetadata());
         } else {
             $schemaTool->updateSchema($this->entityManager->getMetadataFactory()->getAllMetadata());
         }
         $proxyFactory = $this->entityManager->getProxyFactory();
         $proxyFactory->generateProxyClasses($this->entityManager->getMetadataFactory()->getAllMetadata());
         $this->systemLogger->log('Doctrine 2 setup finished');
         return true;
     } else {
         $this->systemLogger->log('Doctrine 2 setup skipped, driver and path backend options not set!', LOG_NOTICE);
         return false;
     }
 }