Hi. 1. No, it doesn't. 2. Yes, you can -- just pass your own query to widget using its "query" option. And, by magic implemented in sfDoctrineRecordI18nFilter::filterGet(), all the values become localized automatically.
2009/8/17 afilina <afil...@gmail.com> > > I have a model generated with Doctrine named Product that has i18n. Now I > need to use the list of products as a dropdown in my form. I use > sfWidgetFormDoctrineChoice. This works great: I specify the model name and > it does everything for me. It even gets the name of the product based on the > current culture. > > The problem is that it executes a DB query for every single Product in > order to get the name. I know that it can be easily solved with a LEFT JOIN. > I tried this query to manually get a list of products: > > Doctrine_Query::create()->from('Product p')->leftJoin('p.ProductTranslation > pt')->execute() > > When I look at the model generated with Doctrine > (lib/model/doctrine/base/BaseProduct.php), I see that all relations are > defined using $this->hasMany(...), whereas the translation is defined using > $this->actAs($i18n0), leaving me no way to refer to it in my leftJoin. > > So I have 2 questions: > 1. Does sfWidgetFormDoctrineChoice support i18n? > 2. If not, how can I select my products + translations with only one query? > > Thanks, > Anna > > > > -- With the best regards, Andy. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~----------~----~----~----~------~----~------~--~---