/**
* Construct 'ORDER BY' clause
*
* @param array $fetchOptions (uses 'order' key)
* @param string $defaultOrderSql Default order SQL
*
* @return string
*/
public function prepareItemOrderOptions(array &$fetchOptions, $defaultOrderSql = '')
{
$choices = array(
'recent' => 'item.date_added',
'rated' => 'item.rating_avg %s, item.rating_count DESC, item.likes DESC, item.view_count DESC',
'reviewed' => 'item.review_count %s, item.rating_avg DESC, item.likes DESC, item.view_count DESC',
'popular' => 'item.view_count %s, item.rating_avg DESC',
'liked' => 'item.likes %s, item.rating_avg DESC, item.view_count DESC',
'updated' => 'item.last_update',
'featured' => 'rand() %s, item.last_update DESC',
'atoz' => 'item.item_name',
'random' => 'rand()',
);
return $this->getOrderByClause($choices, $fetchOptions, $defaultOrderSql);
}