You are here

public function PreviewLinkStorage::createPreviewLinkForEntity in Preview Link 8

Creates a new preview link from a content entity.

Parameters

\Drupal\Core\Entity\ContentEntityInterface $entity: The content entity the preview link is for.

Return value

\Drupal\preview_link\Entity\PreviewLinkInterface The preview link entity.

Overrides PreviewLinkStorageInterface::createPreviewLinkForEntity

File

src/PreviewLinkStorage.php, line 101

Class

PreviewLinkStorage
Preview Link entity storage.

Namespace

Drupal\preview_link

Code

public function createPreviewLinkForEntity(ContentEntityInterface $entity) {
  return $this
    ->createPreviewLink($entity
    ->getEntityTypeId(), $entity
    ->id());
}