getCommitteeId(); $data['endDate'] = $data['startDate']; return parent::initFromForm($data); } protected function _addDependenciesFromDb(array &$data) { parent::_addDependenciesFromDb($data); $data['timeRanges'] = $this->_readTimeRanges(); return $this; } protected function _getFromDbSelect($primaryKey) { $select = parent::_getFromDbSelect($primaryKey); $this->_filterCommitteeEvents($select); return $select; } public function getListSelect() { if (null === $this->_select) { parent::getListSelect(); $this->_filterCommitteeEvents($this->_select); $this->_joinEventTime($this->_select); } return $this->_select; } protected function _filterCommitteeEvents(Zend_Db_Select $select) { $select->where("`e`.`committeeId` = ?", $this->getCommitteeId(), \Qs_Db::INT_TYPE); return $this; } public static function filterEvents(\Zend_Db_Select $select, $alias = 'e') { parent::filterEvents($select, $alias); $select->where("{$alias}.`type` = ?", static::TYPE_COMMITTEE); return; } protected function _joinEventTime(Zend_Db_Select $select) { $select->join( $this->_getPair('EventTime', 'et'), '`et`.`eventId` = `e`.`id`', array('startTime', 'endTime') ); return $this; } protected function _updateDependency() { parent::_updateDependency(); return $this->_saveDependency(); } protected function _insertDependency() { parent::_insertDependency(); return $this->_saveDependency(); } protected function _saveDependency() { $this->_saveTimeRanges($this->_data['startDate'], $this->_data['endDate'], (array) $this->_data['timeRanges']); return $this; } public function setCommitteeId($committeeId) { $this->_committeeId = $committeeId; return $this; } public function getCommitteeId() { if (null === $this->_committeeId) { throw new Qs_Exception_EmptyPropertyException($this, '_committeeId'); } return $this->_committeeId; } }