Ordering finder results

Hello
I have a simple finder that fetches the last 5 posts posted on a specific thread.

Sometimes I'd like to order the posts in an ASC order, other times I'd like to order them DESC.
How can I achieve that?

I now have 2 finders:
PHP:

Код:
$postFinder = \XF::finder('XF:Post')
    ->where('thread_id', $threadId)
    ->order('post_id', 'DESC')
    ->limit($limit);

$reversedPostFinder = \XF::finder('XF:Post')
    ->where('thread_id', $threadId)
    ->order('post_id', 'ASC')
    ->limit($limit)...

Read more

Читать далее...
 
Активность
Пока что здесь никого нет
Назад
Верх Низ