You are here

public function BrokenLink::loadByLink in Broken Link 8

Same name and namespace in other branches
  1. 8.3 src/Entity/BrokenLink.php \Drupal\broken_link\Entity\BrokenLink::loadByLink()
  2. 8.2 src/Entity/BrokenLink.php \Drupal\broken_link\Entity\BrokenLink::loadByLink()

Method to load broken link entity using link.

Parameters

string $link: Broken link.

Return value

\Drupal\Core\Entity\EntityInterface[] Broken link entity.

1 call to BrokenLink::loadByLink()
BrokenLink::merge in src/Entity/BrokenLink.php
Method to create or update broken link and its hits.

File

src/Entity/BrokenLink.php, line 84

Class

BrokenLink
Defines the broken link entity class.

Namespace

Drupal\broken_link\Entity

Code

public function loadByLink($link) {
  $page_access_storage = \Drupal::entityManager()
    ->getStorage('broken_link');
  return array_shift($page_access_storage
    ->loadByProperties([
    'link' => $link,
  ]));
}