You can listen for 'doctrine.configuration' event (to make it works when
using cli ANd web)
In my ^$app/config/$appConfiguration.class.php::configure() :
$this->dispatcher->connect('doctrine.configure', array(__CLASS__,
'configureDoctrine'));
Then I have created in this class a new static method :
static public function configureDoctrine()
{
//To quote column names so we can use db reserved words as column
names (i.e: `order`)
Doctrine_Manager::getInstance()->setAttribute(Doctrine::ATTR_QUOTE_IDENTIFIER,
true);
}
We can certainly do it another way, but it is working in my case. Anyway
using this way we are sure Doctrine is autoloaded by sf.
Hope this helps
Before Printing, Think about Your Environmental Responsibility!
Avant d'Imprimer, Pensez à Votre Responsabilitée Environnementale!
On Thu, Dec 24, 2009 at 2:34 PM, mstralka <[email protected]> wrote:
> In Advent Calendar Day 11 (http://www.symfony-project.org/
> advent_calendar/11/en<http://www.symfony-project.org/%0Aadvent_calendar/11/en>),
> there is the following tip:
> In order for the preDqlDelete() method to be invoked you must enable
> an attribute. The DQL callbacks are off by default due to them costing
> a little extra. So if you want to use them, you must enable them.
> $manager->setAttribute(Doctrine_Core::ATTR_USE_DQL_CALLBACKS, true);
>
> Where do I add the $manager->setAttribute(...) line? Does it go in
> ProjectConfiguration? If so, where does $manager come from?
>
> Thanks
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "symfony users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<symfony-users%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/symfony-users?hl=en.
>
>
>
--
You received this message because you are subscribed to the Google Groups
"symfony users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en.