_attendeeObj = null; return parent::setPrimaryKey($_primaryKey); } public function clearData() { $this->_attendeeObj = null; return parent::clearData(); } protected function _addDependenciesFromDb(array &$data) { $data['eventTime'] = Model::readEventTimeRanges($this->getPrimaryKey()); return parent::_addDependenciesFromDb($data); } protected function _filterShowing(Zend_Db_Select $select) { $select->where($this->_quoteField('showInCalendar') . ' = ?', 'y'); return $this; } /** * @param array $options * @return \App\Event\Attendee\AbstractObj * @throws \Exception */ public function getAttendeeObj(array $options = []) { throw new Exception('Method ' . __METHOD__ . 'should be overwritten'); } public static function getGroupedSubtypes() { $select = Qs_Db::getSelect(); $select->from(Qs_Db::getPair('EventSubtype'), ['typeId', 'id', 'title']) ->order('sorter'); return Qs_Db::getInstance()->fetchAll($select, [], Qs_Db::FETCH_GROUP); } public static function getOptGroupSubtypes4Select() { $select = Qs_Db::getSelect(); $select->from(Qs_Db::getPair('EventSubtype'), ['EventType.title', 'id', 'title']) ->order('EventSubtype.sorter') ->join(Qs_Db::getPair('EventType'), '`EventType`.`id` = `EventSubtype`.`typeId`', []); $grouped = Qs_Db::getInstance()->fetchAll($select, [], Qs_Db::FETCH_GROUP); $result = []; foreach ($grouped as $group => $items) { $result[$group] = []; foreach ($items as $item) { $result[$group][$item['id']] = $item['title']; } } return $result; } }