Added order:tag_count support to post searching

This commit is contained in:
Marcin Kurczewski 2014-09-30 14:53:40 +02:00
parent 81c2025203
commit e0ced89a9b
3 changed files with 4 additions and 1 deletions

1
TODO
View file

@ -29,7 +29,6 @@ everything related to posts:
- order:time - order:time
- order:score - order:score
- order:comment_count - order:comment_count
- order:tag_count
- order:comment_time - order:comment_time
- order:file_size - order:file_size
- order:random (at least unstable version) - order:random (at least unstable version)

View file

@ -5,6 +5,7 @@ class PostFilter extends BasicFilter implements IFilter
{ {
const ORDER_FAV_TIME = 'lastFavTime'; const ORDER_FAV_TIME = 'lastFavTime';
const ORDER_FAV_COUNT = 'favCount'; const ORDER_FAV_COUNT = 'favCount';
const ORDER_TAG_COUNT = 'tagCount';
const REQUIREMENT_TAG = 'tag'; const REQUIREMENT_TAG = 'tag';
const REQUIREMENT_ID = 'id'; const REQUIREMENT_ID = 'id';

View file

@ -40,6 +40,9 @@ class PostSearchParser extends AbstractSearchParser
elseif ($token === 'fav_count') elseif ($token === 'fav_count')
return \Szurubooru\SearchServices\Filters\PostFilter::ORDER_FAV_COUNT; return \Szurubooru\SearchServices\Filters\PostFilter::ORDER_FAV_COUNT;
elseif ($token === 'tag_count')
return \Szurubooru\SearchServices\Filters\PostFilter::ORDER_TAG_COUNT;
throw new \BadMethodCallException('Not supported'); throw new \BadMethodCallException('Not supported');
} }