Hi everybody

I have some troubles with doctrine i18n tables. I have a foo model,
with i18n columns, and i want to fetch each row of this table :

class FooActions extends sfActions
{
  public function executeIndex()
  {
    $this->foos = Doctrine::getTable('Foo')->findAll();
  }
}

But then i have an exception saying : SQLSTATE [HY000]: General error:
1 no such column: p.bar
which is normal, because i didn't include the foo_translation table in
my query.

But if i type this, everythin is OK :
$foo = new Foo();
$this->foos = Doctrine::getTable('Foo')->findAll();

This little hack is not very pretty, so i tried adding my own methods
to the FooTable object :

class FooTable extends Doctrine_Table
{
  public function findAllWithTranslations($culture = 'en')
  {
    $q = $this->createQuery('f')->leftJoin('f.Translation t WITH
t.lang = ?', $culture);
    return $q->execute();
  }
}

But i get the following error : Unknown relation alias Translation. So
i don't know how to do this properly !

Thank's in advance for your help
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to