You are here

public function Redirect::getSourcePathWithQuery in Redirect 8

Gets the source URL path with its query.

Return value

string The source URL path, eventually with its query.

File

src/Entity/Redirect.php, line 179

Class

Redirect
The redirect entity class.

Namespace

Drupal\redirect\Entity

Code

public function getSourcePathWithQuery() {
  $path = '/' . $this
    ->get('redirect_source')->path;
  if ($this
    ->get('redirect_source')->query) {
    $path .= '?' . UrlHelper::buildQuery($this
      ->get('redirect_source')->query);
  }
  return $path;
}