I have searched and played with trying to get the following working.
Any help would be appreciated.
The model relationships are as follows:
Server -> hasMany PolicyConformanceStatements -> belongsTo PolicyCheck
The model definitions are as follows:
Server(/models/server.php)
var $hasMany = array('PolicyConformanceStatement' => array(
'className' =>
'PolicyConformanceStatement',
'foriegnKey' =>
'srv_datum_id'
)
);
PolcyConformanceStatement (/models/pcs.php)
var $belongsTo = array(
'Server' => array('foreignKey' => 'srv_datum_id'),
'PolicyCheck' => array('foreignKey' =>
'policy_check_id')
);
PolicyCheck (/models/policycheck.php)
var $hasMany = array('PolicyConformanceStatements' => array(
'className' =>
'PolicyConformanceStatement',
'foriegnKey' => 'policy_check_id'
)
);
Inside the servers controller:
$data = $this->Server->find('first', array(
'contain' => array
(
'PolicyConformanceStatements' => array( 'PolicyCheck' )
),
'conditions' =>
array(
'Server.uid'
=> $id
)
)
);
The error I get is the following:
Model "PolicyConformanceStatements" is not associated with model
"PolicyCheck"
Am I missing something in my setup?
Thanks,
Davin
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---