_select) { parent::getListSelect(); $this->_filterEnabled($this->_select); $this->_filterShowing($this->_select); $this->_filterUpcoming($this->_select); } return $this->_select; } protected function _filterUpcoming(Zend_Db_Select $select) { $select->reset(Zend_Db_Select::ORDER); $select->where('`e`.`endDate` >= CURDATE()'); $select->having('`eventEnd` > NOW()'); $select->order('eventStart ASC'); return $this; } protected function _prepareList(&$list) { parent::_prepareList($list); if ($list) { $dateRanges = Model::readEventDateRanges(Qs_Array::fetchColAll($list, 'id')); foreach ($list as &$row) { if (array_key_exists($row['id'], $dateRanges)) { $row['dateRanges'] = $dateRanges[$row['id']]; } } } return $this; } }