You are here

protected function RedirectSubscriber::getPatterns in Url Redirect 8.2

Same name and namespace in other branches
  1. 8 src/EventSubscriber/RedirectSubscriber.php \Drupal\url_redirect\EventSubscriber\RedirectSubscriber::getPatterns()

Get redirection.

Parameters

string $path: Source path.

Return value

array

1 call to RedirectSubscriber::getPatterns()
RedirectSubscriber::doRedirect in src/EventSubscriber/RedirectSubscriber.php
Set response to redirection.

File

src/EventSubscriber/RedirectSubscriber.php, line 232

Class

RedirectSubscriber

Namespace

Drupal\url_redirect\EventSubscriber

Code

protected function getPatterns() {
  $storage = $this->entityTypeManagerInterface
    ->getStorage('url_redirect');
  $queryResult = $storage
    ->getQuery()
    ->condition("path", "*", "CONTAINS")
    ->condition('status', 1)
    ->execute();
  return $queryResult;
}