public static function GetRelationQueries($sRelCode) { switch ($sRelCode) { case "impacts": $aRels = array("DatacenterDevice" => array("sQuery" => "SELECT DatacenterDevice WHERE powerA_id = :this->id OR powerB_id = :this->id", "bPropagate" => true, "iDistance" => 10), "pdu" => array("sQuery" => "SELECT PDU WHERE powerstart_id = :this->id", "bPropagate" => true, "iDistance" => 10)); return array_merge($aRels, parent::GetRelationQueries($sRelCode)); break; case 'depends on': $aRels = array(); return array_merge($aRels, parent::GetRelationQueries($sRelCode)); break; default: return parent::GetRelationQueries($sRelCode); } }
/** * Placeholder for backward compatibility (iTop <= 2.1.0) * in case an extension attempts to redefine this function... */ public static function GetRelationQueries($sRelCode) { return parent::GetRelationQueries($sRelCode); }
public static function GetRelationQueries($sRelCode) { switch ($sRelCode) { case "impacts": $aRels = array(); return array_merge($aRels, parent::GetRelationQueries($sRelCode)); break; case "depends on": $aRels = array("connected_network" => array("sQuery" => "SELECT NetworkDevice AS nw JOIN lnkConnectableCIToNetworkDevice AS l1 ON l1.networkdevice_id = nw.id WHERE l1.connectableci_id = :this->id AND l1.connection_type='downlink'", "bPropagate" => true, "iDistance" => 10)); return array_merge($aRels, parent::GetRelationQueries($sRelCode)); break; default: return parent::GetRelationQueries($sRelCode); } }