Welcome Guest, Not a member yet? Register   Sign In
Hasmany in CodeIgniter?
#1

Hi,
I was just wondering if there is the CI models support some kind of HASMANY or BELONGSTO functionality.
I recently touched a Laravel and CakePHP which both have this functionality.
Reply
#2

Relationships are not supported by default.
But you can try using the model extension. https://github.com/tattersoftware/codeig...-relations
Reply
#3

Another package:
https://github.com/michalsn/codeigniter-nested-model
Reply
#4

I am wondering whether using a hasmany construction will slow down each query on that table since it will have to do a join for each select....

Wouldnt it be better/faster to have a method in the entity class which will get the child records? So you you will only have to query them on demand....
Reply




Theme © iAndrew 2016 - Forum software by © MyBB