Question

I have a symfony project (1.2). What I would like to do is ensure that when symfony build happens, instead of creating tables that extend doctrine_table they extend custom_table .

This way I can make ALL the tables I use have additional functionality without having to modify doctrine_table.

Was it helpful?

Solution

Yes you can, as follows (in Symfony 1.4 at least, I assume the same is true for 1.2):

// config/ProjectConfiguration.class.php

class ProjectConfiguration extends sfProjectConfiguration
{
  public function configureDoctrine(Doctrine_Manager $manager)
  {
    $manager->setAttribute(Doctrine_Core::ATTR_TABLE_CLASS, 'yourDoctrineTable');
  }
}

And then define class yourDoctrineTable to extend Doctrine_Table.

All newly generated *Table classes will now extend yourDoctrineTable instead of Doctrine_Table.

See: http://docs.doctrine-project.org/projects/doctrine1/en/latest/en/manual/configuration.html#configure-table-class

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top