public function generateClassFromTable(Doctrine_Table $table)
 {
     $definition = array();
     $definition['columns'] = $table->getColumns();
     $definition['tableName'] = $table->getTableName();
     $definition['actAs'] = $table->getTemplates();
     $definition['generate_once'] = true;
     $generatedclass = $this->generateClass($definition);
     Doctrine::loadModels(sfConfig::get('sf_lib_dir') . '/model/doctrine/opCommunityTopicPlugin/base/');
     return $generatedclass;
 }
Esempio n. 2
0
 /**
  * Generate a Doctrine_Record from a populated Doctrine_Table instance
  *
  * @param Doctrine_Table $table
  * @return void
  */
 public function generateClassFromTable(Doctrine_Table $table)
 {
     $definition = array();
     $definition['columns'] = $table->getColumns();
     $definition['tableName'] = $table->getTableName();
     $definition['actAs'] = $table->getTemplates();
     return $this->generateClass($definition);
 }
Esempio n. 3
0
    /**
     * Checks, whether a table has a Doctrine_Template_I18n-based template.
     *
     * @author Jakub Argasiński <*****@*****.**>
     * @param Doctrine_Table $table
     */
    protected function _hasI18nTemplate(Doctrine_Table $table) {
    	if ($table->hasTemplate('Doctrine_Template_I18n')) {
			return true;
    	}
    	$templates = $table->getTemplates();
    	foreach ($templates as $template) {
    		if (is_subclass_of($template, 'Doctrine_Template_I18n')) {
    			return true;
    		}
    	}
    	return false;
    }