You are here

public function RedirectRepository::findByDestinationUri in Redirect 8

Finds redirects based on the destination URI.

Parameters

string[] $destination_uri: List of destination URIs, for example ['internal:/node/123'].

Return value

\Drupal\redirect\Entity\Redirect[] Array of redirect entities.

File

src/RedirectRepository.php, line 150

Class

RedirectRepository

Namespace

Drupal\redirect

Code

public function findByDestinationUri(array $destination_uri) {
  $storage = $this->manager
    ->getStorage('redirect');
  $ids = $storage
    ->getQuery()
    ->condition('redirect_redirect.uri', $destination_uri, 'IN')
    ->execute();
  return $storage
    ->loadMultiple($ids);
}