You are here

public function SubdomainMethod::contains in Persistent URL 8

Overrides MethodInterface::contains

File

src/Plugin/Purl/Method/SubdomainMethod.php, line 20

Class

SubdomainMethod
Plugin annotation @PurlMethod( id="subdomain", name="Subdomain" )

Namespace

Drupal\purl\Plugin\Purl\Method

Code

public function contains(Request $request, $modifier) {
  $baseHost = $this
    ->getBaseHost();
  if (!$baseHost) {
    return false;
  }
  $host = $request
    ->getHost();
  if ($host === $this
    ->getBaseHost()) {
    return false;
  }
  return $this
    ->hostContainsModifier($modifier, $request
    ->getHost());
}