interface PreviewLinkHostInterface in Preview Link 2.0.x
Same name and namespace in other branches
- 2.x src/PreviewLinkHostInterface.php \Drupal\preview_link\PreviewLinkHostInterface
Interface for relationships between preview links and entities they unlock.
Hierarchy
- interface \Drupal\preview_link\PreviewLinkHostInterface
Expanded class hierarchy of PreviewLinkHostInterface
All classes that implement PreviewLinkHostInterface
2 files declare their use of PreviewLinkHostInterface
File
- src/
PreviewLinkHostInterface.php, line 12
Namespace
Drupal\preview_linkView source
interface PreviewLinkHostInterface {
/**
* Get preview links for an entity.
*
* @param \Drupal\Core\Entity\EntityInterface $entity
* An entity.
*
* @return \Drupal\preview_link\Entity\PreviewLinkInterface[]
* Preview links associated with an entity.
*/
public function getPreviewLinks(EntityInterface $entity) : array;
/**
* Determines if a token unlocks an entity entity.
*
* @param \Drupal\Core\Entity\EntityInterface $entity
* An entity.
* @param string[] $tokens
* An array of Preview Link tokens.
*
* @return bool
* Whether if at least one provided token grants access to the entity.
*/
public function isToken(EntityInterface $entity, array $tokens) : bool;
/**
* Determines if an entity has any active preview links.
*
* @param \Drupal\Core\Entity\EntityInterface $entity
* An entity.
*
* @return bool
* Whether the entity has any associated preview links.
*/
public function hasPreviewLinks(EntityInterface $entity) : bool;
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
PreviewLinkHostInterface:: |
public | function | Get preview links for an entity. | 1 |
PreviewLinkHostInterface:: |
public | function | Determines if an entity has any active preview links. | 1 |
PreviewLinkHostInterface:: |
public | function | Determines if a token unlocks an entity entity. | 1 |