Changeset View
Changeset View
Standalone View
Standalone View
src/applications/almanac/phid/AlmanacInterfacePHIDType.php
Show All 28 Lines | public function loadHandles( | ||||
array $handles, | array $handles, | ||||
array $objects) { | array $objects) { | ||||
foreach ($handles as $phid => $handle) { | foreach ($handles as $phid => $handle) { | ||||
$interface = $objects[$phid]; | $interface = $objects[$phid]; | ||||
$id = $interface->getID(); | $id = $interface->getID(); | ||||
$device_name = $interface->getDevice()->getName(); | $device = $interface->getDevice(); | ||||
$device_name = $device->getName(); | |||||
$address = $interface->getAddress(); | $address = $interface->getAddress(); | ||||
$port = $interface->getPort(); | $port = $interface->getPort(); | ||||
$network = $interface->getNetwork()->getName(); | $network = $interface->getNetwork()->getName(); | ||||
$name = pht( | $name = pht( | ||||
'%s:%s (%s on %s)', | '%s:%s (%s on %s)', | ||||
$device_name, | $device_name, | ||||
$port, | $port, | ||||
$address, | $address, | ||||
$network); | $network); | ||||
$handle->setObjectName(pht('Interface %d', $id)); | $handle->setObjectName(pht('Interface %d', $id)); | ||||
$handle->setName($name); | $handle->setName($name); | ||||
if ($device->isDisabled()) { | |||||
$handle->setStatus(PhabricatorObjectHandle::STATUS_CLOSED); | |||||
} | |||||
} | } | ||||
} | } | ||||
} | } |