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

(This post was last modified: 12-14-2017, 04:49 AM by bawa_d.)

CI do not have model to model relationships as like Yii. Plz implement if possible.

example u have table_one and want to join table_two using their id

Code:
$this->db->select('columns');
$this->db->from('table_one');
$this->db->join('table_two', 'table_two.id = table_one.id');


I know with yii, you can do it this way:
Code:
$posts=Post::model()->with(
'author.profile',
'author.posts',
'categories')->findAll();


this feature should be integrated in CI4. The benefit for implementing this is user ended up with optimized query.
Reply


Messages In This Thread
CI do not have model to model relationships as like Yii. Plz implement if possible. - by bawa_d - 12-14-2017, 02:45 AM



Theme © iAndrew 2016 - Forum software by © MyBB