/** * Compute the "RelatedObjects" in the reverse way * * @param string $sRelCode The code of the relation to use for the computation * @param array $asourceObjects The objects to start with * @param int $iMaxDepth * @param boolean $bEnableReduncancy * * @return RelationGraph The graph of all the related objects */ public static function GetRelatedObjectsUp($sRelCode, $aSourceObjects, $iMaxDepth = 99, $bEnableRedundancy = true, $aContexts = array()) { $oGraph = new RelationGraph(); foreach ($aSourceObjects as $oObject) { $oGraph->AddSinkObject($oObject); } foreach ($aContexts as $key => $sOQL) { $oGraph->AddContextQuery($key, $sOQL); } $oGraph->ComputeRelatedObjectsUp($sRelCode, $iMaxDepth, $bEnableRedundancy); return $oGraph; }