I tried your suggestion, no changes ...
However, var $hasMany = 'Bid' also works ... as the output from
pr($this->User->hasMany) in UsersController shows:
Array
(
    [Bid] => Array
        (
            [className] => Bid
            [foreignKey] => user_id
            [conditions] =>
            [fields] =>
            [order] =>
            [limit] =>
            [offset] =>
            [dependent] =>
            [exclusive] =>
            [finderQuery] =>
            [counterQuery] =>
        )

)
I think if $hasMany is a string Cake converts it to an array first ...

As I said earlier, explicitly stating the fields [i.e.,  $this->User-
>BidSessionRegistration->find('list', array('fields' =>
array('bid_session_id','user_id')));] works, but $this->User-
>BidSessionRegistration->find('list') doesn't, not sure why, but I
suspect it has something to do with this line in the docs: "If no
fields are specified, then 'id' is used for key and 'model-
>displayField' is used for value."

But what puzzles me more is the fact that the bake script correctly
picked up the relation between BidSession and User but not between
User and BidSession. Somehow it came to the conclusion that User is
related more to BidSessionRegistration and so included code to list
BidSessionRegistrations for new users instead of listing BidSessions.


On Aug 20, 3:52 pm, MonkeyGirl <[EMAIL PROTECTED]> wrote:
> >         var $hasMany = 'Bid';
>
> I could be wrong here, but I *think* that this has to be an array,
> even if there's only one item in it.  As in:
>
> var $hasMany = array(
>   'Bid' => array(
>     'className' => 'Bid'
>   )
> );
>
> Does updating that help at all?
>
> Zoe.

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