Hi,

> 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.

Well, don't I need to declare the habtm relationship in both the
models if I want to list students registered for a particular session
as well as list bid sessions a particular student has registered for
(to be used in a different context)?


> 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.

OK ... and I can get the list of associated _users_ only (and not
bids) for a bid session using bind/unbind or Containable behavior,
right?

> 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.

Yeah, my bad ... the documentation says so ... and of course the bake
script wouldn't know which fields I'd want ... but may be it can
default to the two FKs (since it knows this is a join table)?

I'll try re-running the bake script on a fresh "install" and see if it
picks up the associations properly.

I would like to have your opinion on the following points:
A. You'll notice that User--<Bid>--BidSession is a "through"
association, so I could use the "with" condition ... my question is,
will it be too confusing if I have multiple habtm associations between
the same two models? Anyway I'll try this and post what I find.
B. We authenticate logins against our Exchange server, so the users
table doesn't store any passwords ... how difficult is it to use the
Auth component in this setup? Am I better off writing my own
authentication routine?


Thanks a lot for your help!
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to