foreach( User->Project as project ){
foreach( project->Tasks as task){
**** list tasks ****
}
}
But want to list all the tasks of all the projects, order by TASK DATE, without looping on Project. How can I do that ? I have tried the following but it did not work:
foreach( User->Project->Task as task ){
*** list tasks ***
}
I’ve not tried it, but you may be able to set up a HAS_MANY relation to Tasks directly from User, going through your Project relation. You’d be able to set the order in the new relation.
I have no idea if that will work; I’ve never needed to use ‘through’, so it might work differently than I expect.
The reason why I want to go through user is that I want to get all the tasks of "that particular" user. So each user has his/her own projects and tasks.