Fixed unused variable in abstract search service
This commit is contained in:
parent
76f78d61bd
commit
2d9865f1d3
1 changed files with 6 additions and 12 deletions
|
@ -76,19 +76,13 @@ abstract class AbstractSearchService
|
||||||
foreach ($tokens as $token)
|
foreach ($tokens as $token)
|
||||||
{
|
{
|
||||||
$token = preg_split('/,|\s+/', $token);
|
$token = preg_split('/,|\s+/', $token);
|
||||||
if (count($token) === 2)
|
|
||||||
{
|
|
||||||
$orderDir = $token[1] === 'desc' ? self::ORDER_DESC : self::ORDER_ASC;
|
|
||||||
$orderToken = $token[0];
|
$orderToken = $token[0];
|
||||||
}
|
$orderDir = (count($token) === 2 and $token[1] === 'desc') ? self::ORDER_DESC : self::ORDER_ASC;
|
||||||
else
|
|
||||||
{
|
$orderColumn = $this->getOrderColumn($orderToken);
|
||||||
$orderDir = self::ORDER_ASC;
|
|
||||||
$orderToken = $token;
|
|
||||||
}
|
|
||||||
$orderColumn = $this->getOrderColumn($token[0]);
|
|
||||||
if ($orderColumn === null)
|
if ($orderColumn === null)
|
||||||
throw new \InvalidArgumentException('Invalid search order token: ' . $token);
|
throw new \InvalidArgumentException('Invalid search order token: ' . $orderToken);
|
||||||
|
|
||||||
$order[$orderColumn] = $orderDir;
|
$order[$orderColumn] = $orderDir;
|
||||||
}
|
}
|
||||||
$defaultOrderColumn = $this->getDefaultOrderColumn();
|
$defaultOrderColumn = $this->getDefaultOrderColumn();
|
||||||
|
|
Loading…
Reference in a new issue