On Feb 20, 7:01 pm, "codecowboy" <[EMAIL PROTECTED]> wrote:
> Thank you. Can you elaborate a little on that last paragraph? Are
> you talking about adding code to the CollegeDepartment model?
Hi Codecowboy,
Although not mentioned in the manual you can define the fields for an
association (at least iirc you can).
You can see what I'm referring to here:
https://trac.cakephp.org/browser/branches/1.1.x.x/cake/libs/model/model_php4.php#L229
In principle you should be able to one of the following:
1) By defining it in the association directly
<?php
class CollegeDepartmentextends AppModel
{
var $name = 'CollegeDepartment';
var $hasAndBelongsToMany = array('Organization' =>
array(
'fields' => array('user_id','name')
)
);
}
?>
2) by binding a parameter (don't think this currently works)
$this->CollegeDepartment-
>bindModel('Organization'=>array('fields'=>array('user_id','name));
3) By setting it explicitly on the model (a bit dirty)
$this->CollegeDepartment->hasAndBelongsToMany['Organization']
['fields'] = array('user_id','name);
Please reply with success/furthre problems so the thread is complete.
Cheers,
AD
--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---