You are here

PreviewLinkUtility.php in Preview Link 2.0.x

Same filename and directory in other branches
  1. 2.x src/PreviewLinkUtility.php

File

src/PreviewLinkUtility.php
View source
<?php

declare (strict_types=1);
namespace Drupal\preview_link;

use Drupal\Core\Entity\EntityTypeInterface;

/**
 * Preview link utility.
 */
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');
  }

}

Classes

Namesort descending Description
PreviewLinkUtility Preview link utility.