I'm trying to define an association between my models and then call a
set and then save function to upload data from my controller to the
associated model but am running into strange problems, as far as I can
tell I followed the cakephp book exactly but its still giving me an
error.
######## this is how I set the association in my model,
"ModelAssociated" is the model I am associating with
"Retrieveemail"##########
class Retrieveemail extends AppModel {
var $name = 'emailid';
var $primaryKey = 'emailid';
######## Define Model Associations #########
var $hasMany = array(
'ModelAssociated' => array(
'className' => 'ModelAssociated'));
}
############ Then within my RetrieveemailsController I am trying to
call this:
$this->Retrieveemail->ModelAssociated->set(array(
'test' => $extracted_body
));
$this->Retrieveemail->ModelAssociated->save();
####### But it returns this error:
"Notice (8): Undefined property: AppModel::$ModelAssociated"
######## I looked at some posts on this and found that I might try
adding the below code to my RetrieveemailsController, so I tried that
too but still get the same error:
"var $uses=array('Hushmail','ModelAssociated');
######## At this point I have no idea what to do, there doesn't seem
to be documentation that addresses this as I've been searching...
would greatly appreciate any help on this.
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
You received this message because you are subscribed to the Google Groups
"CakePHP" 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