I use symfony’s ProjectConfiguration.class.php for configuring doctrine’s connection:
public function configureDoctrineConnectionCertby(Doctrine_Connection $conn)
{
$conn->setListener(new MyListner());
}
Where should I define MyListner class within a symfony project?
You should make a
lib/Doctrine(orlib/doctrine/Doctrine– this is what Symfony does inside of sfDoctrineGuardPlugin) folder for all Doctrine files. Since Listeners are Doctrine files not Symfony files, you should be following Doctrine naming conventions for them. In this case, MyListener would go in:/lib/Doctrine/Record/Listener/MyListener.phpThis is the “proper” way to do this. It would of course work if you simply threw the files in
/libor/lib/Doctrine.