* @package Combodo\iTop\Application\UI\Layout\ActivityPanel * @since 2.8.0 */ class ActivityPanelFactory { /** * Make an activity panel for an object details layout, meaning that it should contain the caselogs and the activity. * * @param \DBObject $oObject * * @return \Combodo\iTop\Application\UI\Layout\ActivityPanel\ActivityPanel * @throws \CoreException * @throws \Exception */ public static function MakeForObjectDetails(DBObject $oObject) { $oActivityPanel = new ActivityPanel($oObject); // Retrieve case logs entries $aCaseLogAttCodes = array_keys($oActivityPanel->GetCaseLogTabs()); foreach($aCaseLogAttCodes as $sCaseLogAttCode) { /** @var \ormCaseLog $oCaseLog */ $oCaseLog = $oObject->Get($sCaseLogAttCode); foreach($oCaseLog->GetAsArray() as $aOrmEntry) { $oCaseLogEntry = ActivityEntryFactory::MakeFromCaseLogEntryArray($sCaseLogAttCode, $aOrmEntry); $oActivityPanel->AddEntry($oCaseLogEntry); } } // Retrieve history changes return $oActivityPanel; } }