private function buildPropertyList(AlmanacBinding $binding) { $viewer = $this->getViewer(); $properties = id(new PHUIPropertyListView())->setUser($viewer); $properties->addProperty(pht('Service'), $viewer->renderHandle($binding->getServicePHID())); $properties->addProperty(pht('Device'), $viewer->renderHandle($binding->getDevicePHID())); $properties->addProperty(pht('Network'), $viewer->renderHandle($binding->getInterface()->getNetworkPHID())); $properties->addProperty(pht('Interface'), $binding->getInterface()->renderDisplayAddress()); return $properties; }
public function getClusterRepositoryURIFromBinding(AlmanacBinding $binding) { $protocol = $binding->getAlmanacPropertyValue('protocol'); if ($protocol === null) { $protocol = 'https'; } $iface = $binding->getInterface(); $address = $iface->renderDisplayAddress(); $path = $this->getURI(); return id(new PhutilURI("{$protocol}://{$address}"))->setPath($path); }
protected function getAlmanacBindingDictionary(AlmanacBinding $binding) { $interface = $binding->getInterface(); return array('id' => (int) $binding->getID(), 'phid' => $binding->getPHID(), 'properties' => $this->getAlmanacPropertyList($binding), 'interface' => $this->getAlmanacInterfaceDictionary($interface), 'disabled' => (bool) $binding->getIsDisabled()); }