_committeeId = $committeeId; return $this; } public function getCommitteeId() { return $this->_committeeId; } public function initCommitteeData($committeeId) { $this->_committeeId = $committeeId; $this->_committeeData = $this->_getTable('Committee')->findRow($this->_committeeId); if ($this->_committeeData) { $this->_committeeData = $this->_committeeData->toArray(); } return (bool)$this->_committeeData; } public function getLeadershipIds() { return static::getCommitteeLeadershipIds($this->_committeeId); } public static function getCommitteeData($committeeId) { $table = new \Qs_Db_Table('Committee'); return $table->fetchRow(array('id = ' . (int) $committeeId)); } public static function getCommitteeLeadershipIds($committeeId) { $db = \Qs_Db::getInstance(); $select = $db->select() ->from(\Qs_Db::getPair('UserCommittee'), array('userId')) ->where('`committeeId` = ?', $committeeId, \Qs_Db::INT_TYPE) ->where('`roleId` IN (?)', \App\Committee\Obj::getLeadershipRolesId()); return $db->fetchCol($select); } public function initFromForm(array $data) { $data['committeeId'] = $this->_committeeId; return parent::initFromForm($data); } }