beberlei / zf-doctrine

A Zend Framework 1.x and Doctrine 1.2 Integration - UNMAINTAINED
101 stars 21 forks source link

Doctrine_Record_Generator problem #15

Open dgaspar opened 14 years ago

dgaspar commented 14 years ago

In a project with ZFDoctrine, I'm having a hard time using Behaviors that generate their own table/class (ex: log tables, versions, etc..): Doctrine_Record_Generator uses by default Doctrine_Import_Builder. As a result, the auto-generated auxiliary table created by the plugin do not respect ZFDoctrine's model naming conventions.

It would be interesting if we could create Template's plugins extending a ZFDoctrine_Record_Generator class that would override its method generateClass() to use ZFDoctrine_Import_Builder instead of Doctrine_Import_Builder.

virak commented 14 years ago

Yeap, I completly agree. This new Record Generator could be very interesting for future development purposes!

dgaspar commented 14 years ago

obs: when extending the Record Generator, I had to use the following $options so I could have models compatible to those generated by ZFDoctrine's generate-models-from-yaml:

protected $_options = array(
    'className' => '%CLASS%Log',
    'tableName' => '%TABLE%log',
    'generateFiles' => true,
    'generatePath' => './application/models/',
    'table' => false,
    'builderOptions' => array(
        'baseClassesDirectory' => 'Base',
        'generateBaseClasses' => true,
        'generateTableClasses' => true
    )
);