On Tue, Mar 15, 2011 at 5:48 AM, heohni <[email protected]> wrote: > Hi, > > I am using the $virtualFields when I do a paginate for a find. > But it works only when I have not restrictions on the fields. > > var $virtualFields = array( > 'memberfullname' => 'CONCAT(Member.mitg_nachname, ", ", > Member.mitg_vorname)', > ); > > As soon as I limit the fields, I can't select the virtualFields > anymore. > > If I do it manually (DRY??) like fields => > array('CONCAT(Member.mitg_nachname, ", ", Member.mitg_vorname) as > memberfullname') > > I get as result an array like > [Member] => Array > ( > [id] => 5 > [mitg_nummer] => 586858 > [mitg_status] => 1 > ) > [0] => Array > ( > [memberfullname] => xx, xx > > which is stupid, as the memberfullname is not under the [Member] > Array. > > Any ideas how to get arround?
I think LipeDjow's answer may be correct but the answer to the second part is here: http://nuts-and-bolts-of-cakephp.com/2008/09/29/dealing-with-calculated-fields-in-cakephps-find/ -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php
