Re: Multiple Model Pagination

2009-12-30 Thread j0n4s.h4rtm...@googlemail.com
Containable could create multiple queries. This is the solution I went for: http://github.com/ionas/sna/blob/master/www/app/controllers/profiles_controller.php#L112 This could be another solution (not tested yet): http://mark-story.com/posts/view/using-bindmodel-to-get-to-deep-relations (interna

Re: Multiple Model Pagination

2009-12-29 Thread foldiman
Here's a new tutorial that's a bit more relevant http://foldifoldi.com/news/?p=466 On Dec 25, 9:15 am, foldiman wrote: > Andrew, > It sounds like you want to use a join in yourpaginationquery. If you > have set up your model relationships, the joins may happen > automagically. However, you c

Re: Multiple Model Pagination

2009-12-25 Thread foldiman
Andrew, It sounds like you want to use a join in your pagination query. If you have set up your model relationships, the joins may happen automagically. However, you can force the join using the 'joins' parameter in the pagination query. For example: $joins1 = array( 'table' => 'bug_relations', 'a

Re: Multiple Model Pagination

2009-12-25 Thread John Andersen
I would create an SQL statement using UNION to combine all the data from multiple models and ordered by the same ORDER BY. But this means probably that you have to use a custom query and I don't know if that can be paginated! Example: (SELECT a.id AS Result.id, a.name AS Result.name, a.cr

Multiple Model Pagination

2009-12-24 Thread Andrew
Greetings, all, I know other people have worked on this before, but I haven't been able to find a solution so far. So, the long and short of it is that I've got multiple models that I want to mix into one view sorted by the date created. I've got a 'created' datetime field in the database alr