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 GetRelationQueriesEx($sRelCode) { switch ($sRelCode) { case 'impacts': $aRels = array('datacenterdevice' => array('_legacy_' => false, 'sDirection' => 'both', 'sDefinedInClass' => 'PowerConnection', 'sNeighbour' => 'datacenterdevice', 'sQueryDown' => 'SELECT DatacenterDevice WHERE powerA_id = :this->id OR powerB_id = :this->id', 'sQueryUp' => 'SELECT PowerConnection WHERE id = :this->powerA_id OR id = :this->powerB_id', 'sAttribute' => NULL), 'pdu' => array('_legacy_' => false, 'sDirection' => 'both', 'sDefinedInClass' => 'PowerConnection', 'sNeighbour' => 'pdu', 'sQueryDown' => 'SELECT PDU WHERE powerstart_id = :this->id', 'sQueryUp' => 'SELECT PowerConnection WHERE id = :this->powerstart_id', 'sAttribute' => NULL)); return array_merge($aRels, parent::GetRelationQueriesEx($sRelCode)); default: return parent::GetRelationQueriesEx($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); } }