Kohana ORM relationships question?

Your project_users table seems to be representing roles on projects, add another model which is tied to that table: project_role { has one user has one role has one project } user { has many project_role ... } project { has many project_role ... } Then you might be able to do: $user = ORM::factory('user') ->with('project_role') ->where('project_role. Project_id', '=', $id) ->with('project_role:role')->findall() If that doesn't work, one of the following should work, but may be a different form of traversal to what you're after $project = ORM::factory('project', $id); $roles = $project->project_role->with('user')->with('role')->findall() Or $roles = ORM::factory('project_role') ->where('project_id', '=', $id) ->with('user')->with('role')->findall().

Your project_users table seems to be representing roles on projects, add another model which is tied to that table: project_role { has one user has one role has one project } user { has many project_role ... } project { has many project_role ... } Then you might be able to do: $user = ORM::factory('user') ->with('project_role') ->where('project_role. Project_id', '=', $id) ->with('project_role:role')->findall(); If that doesn't work, one of the following should work, but may be a different form of traversal to what you're after. $project = ORM::factory('project', $id); $roles = $project->project_role->with('user')->with('role')->findall(); Or $roles = ORM::factory('project_role') ->where('project_id', '=', $id) ->with('user')->with('role')->findall().

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions