Skip to content
Snippets Groups Projects
Commit 624a4b08 authored by Peter Rotich's avatar Peter Rotich
Browse files

faq: use iterator

parent 91de68d9
No related branches found
No related tags found
No related merge requests found
......@@ -140,8 +140,7 @@ if($_REQUEST['q'] || $_REQUEST['cid'] || $_REQUEST['topicId']) { //Search.
}
} else { //Category Listing.
$categories = Category::objects()
->annotate(array('faq_count'=>SqlAggregate::COUNT('faqs')))
->all();
->annotate(array('faq_count'=>SqlAggregate::COUNT('faqs')));
if (count($categories)) {
$categories->sort(function($a) { return $a->getLocalName(); });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment