I really appreciate the existence of this "model" library and recently tried and successfully integrated it in my Codeigniter 2 project. Maybe this issue is because I customized something or because I tend to keep my models organized in subfolders.
I created has_many_pivot relationship between two tables, with a pivot table containing only the two ids. What I had issue with was the foreign_model field, which is in a subfolder, so the string looks something like this subfolder/users_model. And I suppose you will understand what happens when you place the sting in this code:
$subs[$the_local_key][$the_foreign_key] = $this->{$relation['foreign_model']}->where($foreign_key, $result[$foreign_key])->get();
Basically, the system was looking for $this->subfolder/users_model->where(...), but then I changed from $relation['foreign_model'] to $relation['foreign_model_name'] and everything was fixed.
I don't know if this helps with anything, or if it is a bug fix as well, I thought to share it
I really appreciate the existence of this "model" library and recently tried and successfully integrated it in my Codeigniter 2 project. Maybe this issue is because I customized something or because I tend to keep my models organized in subfolders.
I created has_many_pivot relationship between two tables, with a pivot table containing only the two ids. What I had issue with was the foreign_model field, which is in a subfolder, so the string looks something like this
subfolder/users_model
. And I suppose you will understand what happens when you place the sting in this code:$subs[$the_local_key][$the_foreign_key] = $this->{$relation['foreign_model']}->where($foreign_key, $result[$foreign_key])->get();
Basically, the system was looking for
$this->subfolder/users_model->where(...)
, but then I changed from$relation['foreign_model']
to$relation['foreign_model_name']
and everything was fixed. I don't know if this helps with anything, or if it is a bug fix as well, I thought to share it