class AccessUnpublished in Access unpublished 8
Utility class.
Hierarchy
- class \Drupal\access_unpublished\AccessUnpublished
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_unpublishedView 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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AccessUnpublished:: |
public static | function | Check if the entity type can be used with access unpublished. |