You are here

function pSpring::getBiggestPartner in Visitors 7

Same name and namespace in other branches
  1. 7.2 pChart/class/pSpring.class.php \pSpring::getBiggestPartner()
1 call to pSpring::getBiggestPartner()
pSpring::firstPass in pChart/class/pSpring.class.php

File

pChart/class/pSpring.class.php, line 280

Class

pSpring

Code

function getBiggestPartner($Key) {
  if (!isset($this->Data[$Key]["Connections"])) {
    return "";
  }
  $MaxWeight = 0;
  $Result = "";
  foreach ($this->Data[$Key]["Connections"] as $Key => $PeerID) {
    if ($this->Data[$PeerID]["Weight"] > $MaxWeight) {
      $MaxWeight = $this->Data[$PeerID]["Weight"];
      $Result = $PeerID;
    }
  }
  return $Result;
}