protected function checkSort($sort) { if (!in_array($sort, array('HOUR', 'DAY', 'MONTH', 'YEAR'))) { $sort = 'DAY'; } return $sort; }