im have Relation
protected static $_has_many = array(
'translations' => array(
'key_from' => 'id',
'model_to' => 'Model_Country_Translation',
'key_to' => 'country_id',
'cascade_save' => true,
'cascade_delete' => true,
)
);
---------------Model_Country_Translation
protected static $_primary_key = array('country_id', 'language_code');
protected static $_properties = array(
'country_id',
'language_code',
'name',
'slug',
'description',
'meta_title',
'meta_description',
'meta_keywords',
);
cascade delete not working
$country = Model_Country::find($id);
$country->delete();
Error
Primary key on model Model_Country_Translation cannot be changed.
Please help me fix this
im have Relation
protected static $_has_many = array(
'translations' => array(
'key_from' => 'id',
'model_to' => 'Model_Country_Translation',
'key_to' => 'country_id',
'cascade_save' => true,
'cascade_delete' => true,
)
);
---------------Model_Country_Translation
protected static $_primary_key = array('country_id', 'language_code');
protected static $_properties = array(
'country_id',
'language_code',
'name',
'slug',
'description',
'meta_title',
'meta_description',
'meta_keywords',
);
cascade delete not working
$country = Model_Country::find($id);
$country->delete();
Error
Primary key on model Model_Country_Translation cannot be changed.
Please help me fix this