In an association, today for me it was $belongsTo, I learned that the
associative array you make is required to re-use the class name for
both the className field and the key of the assoc. array, like this:
class Music extends Item {
var $name = 'Music';
var $belongsTo = array(
'MusicDetails' =>
array('className' => 'MusicDetails',
'dependent' => true,
'foreignKey' => 'DetailRef'),
);
}
So the following will fail to work:
class Music extends Item {
var $name = 'Music';
var $belongsTo = array(
'Details' =>
// called this Details as I would prefer
array('className' => 'MusicDetails',
'dependent' => true,
'foreignKey' => 'DetailRef'),
);
}
This seems limiting to me. I expected the key name to be under my
control. What if I wanted to link to the same foreign table in two ways
for two reasons? Like a User that has User 'friends' and User 'enemies'
as a hasManu relationship?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---