/**
  *	Purge any link mappings that point back to the same page.
  *
  *	@parameter <{PAGE_URL}> string
  *	@parameter <{PAGE_ID}> integer
  */
 public function regulateMappings($pageLink, $pageID)
 {
     LinkMapping::get()->filter(array('MappedLink' => MisdirectionService::unify_URL(Director::makeRelative($pageLink)), 'RedirectType' => 'Page', 'RedirectPageID' => $pageID))->removeAll();
 }
 /**
  *	Retrieve the redirection URL for display purposes.
  *
  *	@return string
  */
 public function getLinkSummary()
 {
     return ($link = $this->getLink()) ? MisdirectionService::unify_URL($link) : '-';
 }
 /**
  *	Retrieve the redirection hostname.
  *
  *	@return string
  */
 public function getLinkHost()
 {
     if ($this->RedirectType === 'Page') {
         // Determine the home page URL when appropriate.
         if (($page = $this->getRedirectPage()) && ($link = $page->Link() === Director::baseURL() ? Controller::join_links(Director::baseURL(), 'home/') : $page->Link())) {
             // Determine whether a redirection hostname exists.
             return MisdirectionService::is_external_URL($link) ? parse_url($link, PHP_URL_HOST) : null;
         }
     } else {
         // Apply the regular expression pattern replacement.
         if ($link = $this->LinkType === 'Regular Expression' && $this->matchedURL ? preg_replace("%{$this->MappedLink}%i", $this->RedirectLink, $this->matchedURL) : $this->RedirectLink) {
             // Determine whether a redirection hostname exists.
             return MisdirectionService::is_external_URL($link) ? parse_url($link, PHP_URL_HOST) : null;
         }
     }
     // No redirection hostname has been found.
     return null;
 }