On Sep 12, 2006, at 10:00 AM, Tony wrote:
>
> So I was on the right track with the URL params. I totally agree with
> you that cake makes things a lot easier. I read through pretty much
> the
> entire CakePHP manual, including the models chapter.
>
> Let me refocus my question. If I have those two role fields that
> aren't
> named according to convention, how do I override the default.
You specify the name of the foreign key in the association array.
This is required if you have two ways to associate to a single table
anyway.
var $hasMany = array(
'UserComment' =>
array('className' => 'Comment',
'conditions' => 'Comment.type = 1',
'order' => 'Comment.created DESC',
'limit' => '5',
'foreignKey' => 'user_id',
'dependent' => true,
'exclusive' => false,
'finderSql' => ''
),
'AdminComment' =>
array('className' => 'Comment',
'conditions' => 'Comment.type = 2',
'order' => 'Comment.created DESC',
'limit' => '5',
'foreignKey' => 'admin_id',
'dependent' => true,
'exclusive' => false,
'finderSql' => ''
)
);
> The manual is good and all but it's just so unclear on things. It just
> gives a really really high level view but nothing very well or
> detailed
> in the documentation. That's why I'm here at the google group.
This is a good place to get specific help, but the place to suggest
changes in the manual is Trac. ;o)
-- John
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" 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
-~----------~----~----~----~------~----~------~--~---