Welcome Guest, Not a member yet? Register   Sign In
CI do not have model to model relationships as like Yii. Plz implement if possible.
#4

(This post was last modified: 01-16-2018, 04:40 PM by natanfelles. Edit Reason: add example code )

If relationships are added in the Model, I believe that the configuration style of the Fuel properties are very interesting.

PHP Code:
// in a Model_Post which has many comments
protected static $_has_many = array(
 
   'comments' => array(
 
       'key_from' => 'id',
 
       'model_to' => 'Model_Comment',
 
       'key_to' => 'post_id',
 
       'cascade_save' => true,
 
       'cascade_delete' => false,
 
   )
); 
Reply


Messages In This Thread
RE: CI do not have model to model relationships as like Yii. Plz implement if possible. - by natanfelles - 01-16-2018, 04:38 PM



Theme © iAndrew 2016 - Forum software by © MyBB