Hi,
I have been trying for a while to figure out, is there a way to use a
prefix for model class names or not (see also my message at
doctrine-user: http://bit.ly/30V7Ig).
I've found that Doctrine 1.2 has classPrefix option. Unfortunately for
me, this option is intended only for model builder, and other components
like Doctrine_Query don't use it at all.
But I've noticed that model builder currently produces incorrect class
definitions with this option.
I make use of column aggregation inheritance:
MyEntity:
...
MyExtendedEntity:
inheritance:
extends: MyEntity:
type: column_aggregation
...
with such a schema and classPrefix option I get:
* Prefix_MyExtendedEntity extends Prefix_BaseMyExtendedEntity
* Prefix_BaseMyExtendedEntity extends Prefix_MyEntity
* Prefix_MyEntity extends Prefix_BaseMyEntity
* Prefix_BaseMyEntity extends sfDoctrineRecord
that is correct, but:
* MyExtendedEntityTable extends MyEntity
* MyEntityTable extends Doctrine_Table
although filenames are:
* base/Prefix_BaseMyEntityTable.class.php
* base/Prefix_BaseMyExtendedEntityTable.class.php
* Prefix_MyEntityTable.class.php
* Prefix_MyExtendedEntityTable.class.php
Moreover, specified prefix is also not taken into account for subclasses.
I've fixed both issues by slightly altering Doctrine_Import_Builder, see
attached patch.
--
Best regards,
Eugene Janusov.