Have the model Category a slug attribute?, or better, has it a
getSlug() method?


On 22 bře, 12:19, HiDDeN <davidmoralesmoj...@gmail.com> wrote:
> I'm using Symfony 1.4.3 + Doctrine 1.2, and a typical i18n category
> table (the ids are in category, and the name and slug in
> category_translation).
>
> I have this Doctrine validator defined in my form:
>
> $this->setValidators(array(
>       'category' => new sfValidatorDoctrineChoice(array('model' =>
> 'Category', 'column' => 'slug')),
> ));
>
> So, when I submit the form, I get this error:
>
> Unknown column slug
>
> Then I thought: "ok, maybe I should include a query with the
> Translation table linked, let's do it":
>
> $query = 
> Doctrine_Core::getTable('Category')->createQuery('c')->leftJoin('c.Translation
>  t');
>
> $this->setValidators(array(
>       'category' => new sfValidatorDoctrineChoice(array('model' =>
> 'Category', 'query' => $query, 'column' => 'slug')),
> ));
>
> And when resubmiting, I'm again getting the same error:
>
> Unknown column slug
>
> Mmm... ok, maybe I should define a select statement with the slug
> field defined. So, I redefine my query like this:
>
> $query = Doctrine_Core::getTable('Category')->createQuery('c')->select('c.id, 
> t.name name, t.slug slug')->leftJoin('c.Translation
>
> t');
>
> And again the error:
>
> Unknown column slug
>
> I have no more ideas... what should I do??
>
> Thanks!

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

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

To unsubscribe from this group, send email to 
symfony-users+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.

Reply via email to