You are here

class AccessUnpublished in Access unpublished 8

Utility class.

Hierarchy

Expanded class hierarchy of AccessUnpublished

3 files declare their use of AccessUnpublished
AccessUnpublishedForm.php in src/Form/AccessUnpublishedForm.php
access_unpublished.module in ./access_unpublished.module
Contains access_unpublished implementations.
access_unpublished.tokens.inc in ./access_unpublished.tokens.inc
Contains access_unpublished token includes.

File

src/AccessUnpublished.php, line 11

Namespace

Drupal\access_unpublished
View source
class AccessUnpublished {

  /**
   * Check if the entity type can be used with access unpublished.
   *
   * @param \Drupal\Core\Entity\EntityTypeInterface $entityType
   *   The entity type.
   *
   * @return bool
   *   TRUE if it can be used.
   */
  public static function applicableEntityType(EntityTypeInterface $entityType) {
    if (in_array(EntityPublishedInterface::class, class_implements($entityType
      ->getClass())) && $entityType
      ->hasLinkTemplate('canonical')) {
      return TRUE;
    }
    return FALSE;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
AccessUnpublished::applicableEntityType public static function Check if the entity type can be used with access unpublished.