| @@ 173-186 (lines=14) @@ | ||
| 170 | $article_prefix . 'blog_id', |
|
| 171 | $article_prefix . 'art_time' |
|
| 172 | ]; |
|
| 173 | switch ($query_type) { |
|
| 174 | case 'category': |
|
| 175 | $articles_obj = $articleHandler->getByCategory($criteria, $tags); |
|
| 176 | $count_article = $articleHandler->getCountByCategory($criteria); |
|
| 177 | break; |
|
| 178 | case 'bookmark': |
|
| 179 | $articles_obj = $articleHandler->getByBookmark($criteria, $tags); |
|
| 180 | $count_article = $articleHandler->getCountByBookmark($criteria); |
|
| 181 | break; |
|
| 182 | default: |
|
| 183 | $articles_obj = $articleHandler->getAll($criteria, $tags); |
|
| 184 | $count_article = $articleHandler->getCount($criteria); |
|
| 185 | break; |
|
| 186 | } |
|
| 187 | ||
| 188 | if (!empty($blog_data)) { |
|
| 189 | $blogs[$blog_data['id']] = $blog_data['title']; |
|
| @@ 139-152 (lines=14) @@ | ||
| 136 | $criteria->setLimit($limit); |
|
| 137 | ||
| 138 | $tags = empty($list) ? '' : [$blog_prefix . 'blog_title', $blog_prefix . 'blog_time']; |
|
| 139 | switch ($query_type) { |
|
| 140 | case 'category': |
|
| 141 | $blogs_obj = $blogHandler->getByCategory($criteria, $tags); |
|
| 142 | $count_blog = $blogHandler->getCountByCategory($criteria); |
|
| 143 | break; |
|
| 144 | case 'bookmark': |
|
| 145 | $blogs_obj = $blogHandler->getByBookmark($criteria, $tags); |
|
| 146 | $count_blog = $blogHandler->getCountByBookmark($criteria); |
|
| 147 | break; |
|
| 148 | default: |
|
| 149 | $blogs_obj = $blogHandler->getAll($criteria, $tags); |
|
| 150 | $count_blog = $blogHandler->getCount($criteria); |
|
| 151 | break; |
|
| 152 | } |
|
| 153 | ||
| 154 | /* Objects to array */ |
|
| 155 | $blogs = []; |
|