Here is an example of what I mean:
$liked = $this->Like->getMostLiked(); // <-- returns a pre-ordered list the way I want
$this->loadModel('User');
$like_list = array();
foreach ($liked as $user):
$list = $this->User->find('first', array(
'contain' => array('Like'),
'conditions' => array('User.id' => $user )));
array_push($like_list, $list);
endforeach;
echo debug($like_list); die; // <-- returns the list of results in exactly the order I want
The only real problem I'm having is that I need my results to be paginated. I played around with custom pagination but things are not working out the way that I would like.
Thanks in advance,
ED
-- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
No comments:
Post a Comment