_select) { parent::getListSelect(); $this->_filterEnabled($this->_select); $this->_filterUpcoming($this->_select); } return $this->_select; } protected function _filterUpcoming(Zend_Db_Select $select) { $select ->reset(Zend_Db_Select::ORDER) ->reset(Zend_Db_Select::LIMIT_COUNT) ->reset(Zend_Db_Select::LIMIT_OFFSET); $select->where('`e`.`endDate` >= CURDATE()'); $select->having('`eventEnd` > NOW()'); $select->order('eventStart ASC'); if (($limit = (int) $this->getConfig('upcomingLimit'))) { $select->limit($limit); } return $this; } }