This repository has been archived on 2025-02-26. You can view files and clone it, but cannot push or open issues or pull requests.
szurubooru/src/Models/SearchParsers/UserSearchParser.php

31 lines
719 B
PHP
Raw Normal View History

<?php
class UserSearchParser extends AbstractSearchParser
{
protected function processSimpleToken($value, $neg)
{
if ($neg)
return false;
if ($value == 'pending')
{
$this->statement->setCriterion((new SqlDisjunctionFunctor)
->add(new SqlIsFunctor('staff_confirmed', new SqlNullFunctor()))
->add(new SqlEqualsFunctor('staff_confirmed', '0')));
return true;
}
return false;
}
protected function processOrderToken($orderByString, $orderDir)
{
if ($orderByString == 'alpha')
$this->statement->setOrderBy(new SqlNoCaseFunctor('name'), $orderDir);
elseif ($orderByString == 'date')
$this->statement->setOrderBy('join_date', $orderDir);
else
return false;
return true;
}
}