public function RefreshParticipationList() { $fltStartTime = microtime(true); $objGroupRole = GroupRole::QuerySingle(QQ::AndCondition(QQ::Equal(QQN::GroupRole()->MinistryId, $this->Group->MinistryId), QQ::Equal(QQN::GroupRole()->GroupRoleTypeId, GroupRoleType::Participant)), QQ::OrderBy(QQN::GroupRole()->Id)); if (!$objGroupRole) { $objGroupRole = new GroupRole(); $objGroupRole->MinistryId = $this->Group->MinistryId; $objGroupRole->Name = 'Participant'; $objGroupRole->GroupRoleTypeId = GroupRoleType::Participant; $objGroupRole->Save(); } $this->Group->DeleteAllGroupParticipations(); $objPersonCursor = $this->SearchQuery->Execute(); while ($objPerson = Person::InstantiateCursor($objPersonCursor)) { $this->Group->AddPerson($objPerson, $objGroupRole->Id); } $fltEndTime = microtime(true); $this->dttDateRefreshed = QDateTime::Now(); $this->ProcessTimeMs = round(($fltEndTime - $fltStartTime) * 1000); $this->Save(); }
/** * Load a single GroupRole object, * by Id Index(es) * @param integer $intId * @return GroupRole */ public static function LoadById($intId, $objOptionalClauses = null) { return GroupRole::QuerySingle(QQ::Equal(QQN::GroupRole()->Id, $intId), $objOptionalClauses); }