Hi Amitava,
> I have pasted the app code at:
> http://bin.cakephp.org/view/409355633
> and the sql schema at:
> http://bin.cakephp.org/view/305474219
that's really helped, much easier to follow.
Ok, first thing is I think it might be a good idea to not have
duplicate association names, you Currently have
Bid belongsTo User,BidSession
BidSession hasMany Bid
BidSession hasAndBelongsToMany User
User hasMany Bid
User hasAndBelongsToMany BidSession
I really think you'd be better off calling the last one
BidSessionRegistrations, to avoid confusion internally.
When you do (line 116):
$users = $this->BidSession->User->find('list');
you aren't asking cake to grab the users from a particular session,
you are tunnelling directly to the User model and finding ALL users!
The easiest way to get the Users for a particular BidSession is let
cake do it for you by increasing the recursive level above 0 on the
BidSession model. If you have linked up any users to a BidSession,
they will automatically be retrieved by cake unless you ask them not
to be when you find the BidSession record.
I think the problem with line 170:
$bidSessionRegistrations = $this->User->BidSessionRegistration->find('list');
is that cake defaults to using 'id', 'name' for the fields in
find('list'), if you want need something other than that you have to
explicitly tell cake.
think we're getting there, try the above out and let us know.
cheers,
Jon
--
jon bennett
w: http://www.jben.net/
iChat (AIM): jbendotnet Skype: jon-bennett
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" 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
-~----------~----~----~----~------~----~------~--~---