So, I wanted to write a plugin DoctrineActAsSomething.
The existing plugins don't generate classes (or from the schema.yml)
so my template extends "Doctrine_Record_Generator".
The code in my previous message works and will generate the base class
(etc),
but in the project NOT in the plugin.
The reason comes fron the Doctrine/Record/Generator.php
function generateClass(array $definition = array())
$builder->buildRecord($definition);
is called, and expect a $definition['package'] to build the class in
the package/plugin
or it is not possible, because generateClass() is called from :
public function generateClassFromTable(Doctrine_Table $table)
{
$definition = array();
$definition['columns'] = $table->getColumns();
$definition['tableName'] = $table->getTableName();
$definition['actAs'] = $table->getTemplates();
return $this->generateClass($definition);
}
So for now, adding at the line 449 this code, works fine :
if( isset($this->_options['package']) )
{
$definition['package'] = (isset($this->_options
['package'])) ? $this->_options['package'] : null;
$builder->setOption('packagesPath', (isset($this-
>_options['packagesPath'])) ? $this->_options['packagesPath'] :
null );
}
I dont know how the builder is able to write in the plugin directory
from a schema.yml.
Somehow another buillder must extend this one .. I dont know.
--
You received this message because you are subscribed to the Google Groups
"symfony users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en.