private function decodeQueryOrder($contenttype, $orderValue)
{
$order = false;
if ($orderValue === false || $orderValue === '') {
if ($this->isValidColumn($contenttype['sort'], $contenttype, true)) {
$order = $this->getEscapedSortorder($contenttype['sort'], false);
}
} else {
$parOrder = Str::makeSafe($orderValue);
if ($parOrder == 'RANDOM') {
$dboptions = $this->app['db']->getParams();
$order = $dboptions['randomfunction'];
} elseif ($this->isValidColumn($parOrder, $contenttype, true)) {
$order = $this->getEscapedSortorder($parOrder, false);
}
}
return $order;
}