Added ability to search tags by usage count
This commit is contained in:
parent
96195f0efc
commit
b3c5212c84
2 changed files with 11 additions and 0 deletions
|
@ -13,6 +13,7 @@ class TagFilter extends BasicFilter implements IFilter
|
|||
const REQUIREMENT_CREATION_TIME = 'creationTime';
|
||||
const REQUIREMENT_LAST_EDIT_TIME = 'lastEditTime';
|
||||
const REQUIREMENT_CATEGORY = 'category';
|
||||
const REQUIREMENT_USAGE_COUNT = 'usages';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
|
|
|
@ -40,6 +40,16 @@ class TagSearchParser extends AbstractSearchParser
|
|||
return;
|
||||
}
|
||||
|
||||
if ($this->matches($token->getKey(), ['usage_count', 'usages', 'usage']))
|
||||
{
|
||||
$this->addRequirementFromToken(
|
||||
$filter,
|
||||
$token,
|
||||
TagFilter::REQUIREMENT_USAGE_COUNT,
|
||||
self::ALLOW_RANGES | self::ALLOW_COMPOSITE);
|
||||
return;
|
||||
}
|
||||
|
||||
if ($this->matches($token->getKey(), ['category']))
|
||||
{
|
||||
$this->addRequirementFromToken(
|
||||
|
|
Loading…
Reference in a new issue