/** * Called to refresh the list of participations for this GroupCategory */ public function RefreshParticipationList() { $fltTime = microtime(true); GroupParticipation::GetDatabase()->NonQuery('DELETE FROM group_participation WHERE group_id=' . $this->intGroupId); $objPersonArray = array(); foreach ($this->Group->GetThisAndChildren() as $objGroup) { if ($objGroup->GroupTypeId != GroupType::GroupCategory) { foreach ($objGroup->GetGroupParticipationArray() as $objParticipation) { $objPersonArray[$objParticipation->PersonId] = $objParticipation->Person; } } } foreach ($objPersonArray as $objPerson) { $this->Group->AddPerson($objPerson, null); } $intTime = round((microtime(true) - $fltTime) * 1000); $this->DateRefreshed = QDateTime::Now(); $this->ProcessTimeMs = $intTime; $this->Save(); }
/** * Gets the historical journal for an object from the log database. * Objects will have VirtualAttributes available to lookup login, date, and action information from the journal object. * @param integer intId * @return GroupParticipation[] */ public static function GetJournalForId($intId) { $objDatabase = GroupParticipation::GetDatabase()->JournalingDatabase; $objResult = $objDatabase->Query('SELECT * FROM group_participation WHERE id = ' . $objDatabase->SqlVariable($intId) . ' ORDER BY __sys_date'); return GroupParticipation::InstantiateDbResult($objResult); }