Ejemplo n.º 1
0
 public function dump()
 {
     $schemas = [];
     $extendProvider = $this->em->getExtendConfigProvider();
     $extendConfigs = $extendProvider->getConfigs(null, true);
     foreach ($extendConfigs as $extendConfig) {
         $schema = $extendConfig->get('schema');
         $className = $extendConfig->getId()->getClassName();
         if ($schema) {
             $schemas[$className] = $schema;
             $schemas[$className]['relationData'] = $extendConfig->get('relation');
         }
     }
     $cacheDir = $this->entityGenerator->getCacheDir();
     if ($cacheDir === $this->cacheDir) {
         $this->entityGenerator->generate($schemas);
     } else {
         $this->entityGenerator->setCacheDir($this->cacheDir);
         try {
             $this->entityGenerator->generate($schemas);
             $this->entityGenerator->setCacheDir($cacheDir);
         } catch (\Exception $e) {
             $this->entityGenerator->setCacheDir($cacheDir);
             throw $e;
         }
     }
 }
Ejemplo n.º 2
0
 public function dump()
 {
     $schemas = [];
     $extendProvider = $this->em->getExtendConfigProvider();
     $extendConfigs = $extendProvider->getConfigs(null, true);
     foreach ($extendConfigs as $extendConfig) {
         $schema = $extendConfig->get('schema');
         $className = $extendConfig->getId()->getClassName();
         if ($schema) {
             $schemas[$className] = $schema;
             $schemas[$className]['relationData'] = $extendConfig->get('relation');
         }
     }
     $this->entityGenerator->generate($schemas);
 }