Exemplo n.º 1
0
 private function _initPropel($propelConfig)
 {
     if (!file_exists($propelConfig)) {
         throw new ZFscaffold_ZfTool_Exception("Propel config {$propelConfig} not exist");
     }
     //require_once $this->cwd. . '/../library/propel/Propel.php';
     Propel::init($propelConfig);
     $propelConf = Propel::getConfiguration();
     if ($propelConf['classmap']) {
         foreach ($propelConf['classmap'] as $class => $file) {
             if (substr($class, -4) === 'Peer') {
                 class_exists($class);
             }
         }
     }
     $this->tables = Propel::getDatabaseMap()->getTables();
     /** @var $table TableMap */
     foreach ($this->tables as $table) {
         $table->buildRelations();
         Dfi_Propel_Helper::bulidRelationsOnFK($table);
         Dfi_Propel_Helper::findAutoLabel($table);
     }
 }