perfect, thanks!

On Nov 4, 1:40 pm, Alexandre SALOME <[email protected]>
wrote:
> Have a look at sfDoctrineRecord class, in
> symfony/lib/plugins/sfDoctrinePlugin/lib/record
>
> Every record class inherits from it.
>
> There is a method __toString() on it and the magic is there :
>
> public function __toString()
>   {
>     $guesses = array('name',
>                      'title',
>                      'description',
>                      'subject',
>                      'keywords',
>                      'id');
>
>     // we try to guess a column which would give a good description of the
> object
>     foreach ($guesses as $descriptionColumn)
>     {
>       ...
>     }
>   }
>
> 2009/11/4 lorenx <[email protected]>
>
>
>
>
>
>
>
> > i understood that, since both group and credential model has a "name"
> > attribute, getName() is called by default.
> > i had to add a __toString() method in the user model that returns its
> > getName() and now it works.
>
> > but i didn't find where this magic is...
> > thanks anyway.
>
> > On Nov 3, 9:18 pm, lorenx <[email protected]> wrote:
> > > hi all,
> > > i have a group and user many-to-many relation, joined on a groupuser
> > > table/model.
> > > i also have a group and credential many-to-many relation, joined on an
> > > analogous groupcredential table/model.
>
> > > with "symfony doctrine:generate-module" i generated all forms and when
> > > i browse the group form i see two multiselect;
> > > the credential multiselect values are (accidentally) based on the
> > > "name" column (not a primary key) but the user multiselect displays
> > > the user ids.
>
> > > how could this happend?
> > > and... how to change this behavior?
>
> > > i find just a few pages on this,
> > > thanks.
>
> --
> Alexandre Salomé -- [email protected]
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to