I'm trying to get symfony to use a custom class called jsDoctrineRecord
instead of sfDoctrineRecord
for its models. Here's the code for the overriding class:
<?php
abstract class jsDoctrineRecord extends sfDoctrineRecord
{
public function foo()
{
echo 'foo';exit;
}
}
Here's what I have in config/ProjectConfiguration.class.php
, per the instructions here:
<?php
require_once dirname(__FILE__).'/../lib/vendor/symfony/lib/autoload/sfCoreAutoload.class.php';
sfCoreAutoload::register();
class ProjectConfiguration extends sfProjectConfiguration
{
public function setup()
{
$this->enablePlugins('sfDoctrinePlugin');
$this->enablePlugins('sfDoctrineGuardPlugin');
$this->enablePlugins('jsDoctrineSchemaOverriderPlugin');
}
public function configureDoctrine(Doctrine_Manager $manager)
{
$options = array('baseClassName' => 'jsDoctrineRecord');
sfConfig::set('doctrine_model_builder_options', $options);
}
}
Unfortunately, this doesn't work. My models continue to inherit from sfDoctrineRecord
instead of jsDoctrineRecord
. The foo()
method is not recognized. I still have the problem when I clear my cache.
I'm pretty sure I'm following the instructions right, so what could be going wrong?