You are here

public function RedirectRepository::findBySourcePath in Redirect 8

Finds redirects based on the source path.

Parameters

string $source_path: The redirect source path (without the query).

Return value

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

File

src/RedirectRepository.php, line 134

Class

RedirectRepository

Namespace

Drupal\redirect

Code

public function findBySourcePath($source_path) {
  $ids = $this->manager
    ->getStorage('redirect')
    ->getQuery()
    ->condition('redirect_source.path', $source_path, 'LIKE')
    ->execute();
  return $this->manager
    ->getStorage('redirect')
    ->loadMultiple($ids);
}