You are here

class PreviewLinkUtility in Preview Link 2.x

Same name and namespace in other branches
  1. 2.0.x src/PreviewLinkUtility.php \Drupal\preview_link\PreviewLinkUtility

Preview link utility.

Hierarchy

Expanded class hierarchy of PreviewLinkUtility

2 files declare their use of PreviewLinkUtility
PreviewLinkRoutes.php in src/Routing/PreviewLinkRoutes.php
preview_link.module in ./preview_link.module
Module file.

File

src/PreviewLinkUtility.php, line 12

Namespace

Drupal\preview_link
View source
class PreviewLinkUtility {

  /**
   * Determines if an entity type is supported by Preview Link.
   *
   * @param \Drupal\Core\Entity\EntityTypeInterface $entityType
   *   An entity type.
   *
   * @return bool
   *   Whether an entity type is supported by Preview Link.
   */
  public static function isEntityTypeSupported(EntityTypeInterface $entityType) : bool {
    return $entityType
      ->isRevisionable() && $entityType
      ->hasLinkTemplate('canonical');
  }

}

Members

Namesort descending Modifiers Type Description Overrides
PreviewLinkUtility::isEntityTypeSupported public static function Determines if an entity type is supported by Preview Link.