Hi I need to do something like this:
$hours->task->job->where('group_id' , '=' , $num)->find_all();
This would return job information. Is there any way to tell orm to return the information from the $hours table instead?
Hi I need to do something like this:
$hours->task->job->where('group_id' , '=' , $num)->find_all();
This would return job information. Is there any way to tell orm to return the information from the $hours table instead?
First of all, your basic PHP is wrong.
Also, make sure the plurality is accurate in the chaining:
$task->jobs assumes that task has a one to many relationship with jobs. You can't use find_all unless it does.
That would be defined in your Model.
Try:
$task = ORM::factory( 'task' , $some_task_id );
$hours = $task->jobs->where( 'group_id', '=', $num )->find_all();
This assumes that the 'group_id' value is a column in the job Model.
Hope this helps a little. Add comments if you need more help.