db->select(); $select->from($this->pair, array('year' => 'DATE_FORMAT(published, \'%Y\')')) ->distinct(); if ($ascOrder) { $select->order('published'); } else { $select->order('published DESC'); } if ($showActiveOnly){ $select->where('`show` = ?', 'y'); } return $this->db->fetchCol($select); } public function setCurrentYear($year) { $this->_year = (int)$year; return $this; } public function getCurrentYear() { return $this->_year; } }