You are here

public function Domain::getPort in Domain Access 8

Find the port used for the domain.

Return value

string An optional port string (e.g. ':8080') or an empty string;

Overrides DomainInterface::getPort

File

domain/src/Entity/Domain.php, line 540

Class

Domain
Defines the domain entity.

Namespace

Drupal\domain\Entity

Code

public function getPort() {
  $ports = explode(':', $this
    ->getHostname());
  if (isset($ports[1])) {
    return ':' . $ports[1];
  }
  return '';
}