Created
April 20, 2012 15:05
-
-
Save radmiraal/2429440 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 \Doctrine\ORM\Tools\SchemaTool($this->entityManager); | |
///// Why this check? | |
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'); | |
//// Isn't this now always returning true if nothing fatal happens? | |
return TRUE; | |
} else { | |
$this->systemLogger->log('Doctrine 2 setup skipped, driver and path backend options not set!', LOG_NOTICE); | |
return FALSE; | |
} | |
} |
Author
radmiraal
commented
Apr 20, 2012
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment