I must be missing something... maybe fresh eyes can see the problem.
Hopefully! I have a complex set of table associations that looks like
this:
layers
id
ruleexceptions
id
rulevaluetypes
id
layerrules
id
layer1_id
layer2_id
ruleexception_id
ruleitems
id
layerrule_id
exception_id
ruleitemvalues
id
ruleitem_id
rulevaluetype_id
Everything works great, except I can't get layerrules and ruleitems to
link up. The model for layerrules says:
models/layerrule.php:var $hasMany = array('Ruleitem');
models/ruleitem.php: var $belongsTo = array
('Kit','Ruleexception','Layerrule');
Trying to read using any of these models works great except Ruleitem
doesn't link up to Layerrule. No errors or anything. Here's one of
my sample queries from Ruleitemvalue model:
function getByRIV($list)
{
$find = array_keys
($list);
$get = $this->find('all', array(
'contain' => array(
'Ruleitem' => array(
'Layerrule',
'Ruleexception',
),
),
'conditions' => array("Ruleitemvalue.id" => $find),
)
);
return $get;
}
Snippet from the data returned:
Array
(
[0] => Array
(
[Ruleitemvalue] => Array
(
[id] => 26
[rulevaluetype_id] => 1
[ruleitem_id] => 14
[kit_id] => 1
[value] => 2
[rule] => def
[valid] =>
)
[Ruleitem] => Array
(
[id] => 14
[layerrule_id] => 24
[ruleexception_id] => 5
[kit_id] => 1
[Ruleexception] => Array
(
[id] => 5
[name] => ntie
[desc] =>
[kit_id] => 1
[nonexception] => 0
)
)
)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---