possible to use find('list') across models?

are there any cakephp way of using find('list', array('fields' => array('User.id', 'Profile.nickname')))); ?

if i do that it'll throw an error.

for the time being i am using a function i wrote to get the list, not flexible function at that.

Your helps are appreciated. Thank you all.

Asked by yesk13, on 7/1/10

1 Answer

$this->User->Profile->find('list', array('fields' => array('Profile.user_id', 'Profile.nickname'))));

Answered by dogmatic69on 7/1/10

this kind of work, but if i want something else in User.somethingelse i am out of luck while trying to get nickname from profile or any other fields from profile. but you answer did solve my problem using CakePHP way. Thanks!

yesk13 - on 7/1/10

<< comments | comments >>
<< previous next >>

Tagged with

Rating

0

Viewed

394 times

Last Activity

on 7/1/10