Greetings! I’ve been racking my brain about this for a couple days, and finding it hard to accomplish what I want using Advanced Relationships techniques.
I have a contentprovider model, and a retentionrule model. Contentprovider will have two retention rules; a CDN one, and a Local one.
contentprovider
var $has_one = array(
'priority' => array(),
'cdn_rule' => array(
'class' => 'retentionrule',
'other_field' => 'cdn_retentionrule'
),
'local_rule' => array(
'class' => 'retentionrule',
'other_field' => 'local_retentionrule'
)
);
retentionrule
var $has_one = array(
'cdn_retentionrule' => array(
'class' => 'contentprovider',
'other_field' => 'cdn_rule'
),
'local_retentionrule' => array(
'class' => 'contentprovider',
'other_field' => 'local_rule'
),
);
For the tables, they have ‘id’ fields and the join tables look like this:
contentprovider_retentionrule
id, cdn_retentionrule_id, local_retentionrule_id, contentprovider_id
..And I’m getting
An Error Was Encountered
Unable to relate contentprovider with retentionrule.
I just know I’m doing something wrong, but I can’t figure what it is!? I’m on CI2 & DM1.8