Also you could use the afterFind() method and append the two columns
into a new one.
On Apr 11, 10:24 am, PeteWilliams <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I've only been baking a couple days, so I'm probably missing something
> obvious here! I've got a users table which has first names and second
> names, but for my listing display on the index action, i want to
> include their full names. Due to the generic way i've implemented by
> listing element, I basically want to have a property in the model
> called 'name' which contains the full name.
>
> I'd hoped that by doign this in the controller it would do that:
>
> $this->{$this->modelClass}->findAll( null, "*, CONCAT(first_name, ' ',
> surname) AS name" )
>
> That does get the name, but instead of adding it to the 'User' keyed-
> array, it adds it to a sibling array of key '0'.
>
> Anyone care to point our where I've gone wrong?
>
> Cheers
>
> Pete
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" 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/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---