Hi Jon,

I really appreciate your help. Thanks to you, I hope my cake will turn
out good :).

> that wasn't really my point, from your model setup something struck me
> as odd, though looking at it now I can't see it, so perhaps it's fine!

Generally gut reactions are true, so if you ever recall what you
though was odd, do let me know! :)
> > 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?
>
> no!! you don't need to. The associated users will automatically be
> returned by cake, no subsequent query (call to a find method) or
> unbind/bind required. I suggest you analyse the the data outputted by:

What I meant was, BidSession is associated with both Bid & User, so a
recursion level > 0 will return both Bids and Users for that
particular session, so if I want only Users (or only Bids), I should
be using unbind/Containable ... am I correct?

> I don't think you can do a find(list) on a join table directly.
> Generally I do one of two things.
>
> a) When I have to deal with the data in the join table, I 'massage'
> the data (using the Set class) into the list I need (that's the
> example I provided) - I would use this to obtain the 'selected'
> indexes when dealing with a multiple select tag
> b) grab all the records to populate a multiple select tag
>
> neither of the above ever require me to directly access the join
> model, it's all handled automatically.

The join table will (for now, at least) be populated from an external
source. I just need to check if the logged-in user has registered for
the current bid session. Guess I can just do this (in
users_controller.php):
    $this->User->BidSessionRegistration->find('count',
array('conditions' => array('BidSessionRegistration.user_id' =>
$userId, 'BidSessionRegistration.bid_session_id' => $bidSessionId)));

> > I'll try re-running the bake script on a fresh "install" and see if it
> > picks up the associations properly.
>
> I think you'd be better off skipping bake and getting your hands
> dirty. writing cake code is pretty quick, and you'll learn how things
> are tied together much better this way. Start at the blog 
> tutorialhttp://book.cakephp.org/view/219/blogand expand from there.

That's a most sensible suggestion :). I generally do things that way--
I love hand-coded html--this time I was just playing with the bake
script (or just call me lazy :)).

> You'll need to use with if you want extra columns in your habtm. it
> works really well, though I don't follow why you need multiple habtm
> associations between the same two models with 'with'. why not forget
> the with and set the condition on each habtm.
>
> var $hasAndBelongsToMany = array(
>         'UsersCalledJoe'=>array(
>                 'model'=>'User'
>                 'joinTable' => 'bid_session_registrations',
>                 'name'=>'Joe'
>         )
> );

Unfortunately I need to track extra variables in the Bid model--e.g.
points bid, time of bid submission, etc etc. So I think I have to use
the 'with' param.

> I think that's best posted as a separate message, as I don't know
> anything about exchange server, sorry!

Sorry if it sounded Exchange specific ... it's just plain POP3
authentication. I think I will handle that on my own; even the OpenID
component (which is conceptually similar) is separate from the Auth
component--ahh, if only Auth was plugin-based!


Thanks and regards,
Amitava
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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