You are here

EntityContextHandlerInterface.php in Core Context 8

File

src/EntityContextHandlerInterface.php
View source
<?php

namespace Drupal\core_context;

use Drupal\Core\Entity\EntityHandlerInterface;
use Drupal\Core\Entity\EntityInterface;

/**
 * Defines an interface for entity handlers that expose contexts.
 */
interface EntityContextHandlerInterface extends EntityHandlerInterface {

  /**
   * Returns all contexts attached to an entity.
   *
   * @param \Drupal\Core\Entity\EntityInterface $entity
   *
   * @return \Drupal\Component\Plugin\Context\ContextInterface[]
   */
  public function getContexts(EntityInterface $entity);

}

Interfaces

Namesort descending Description
EntityContextHandlerInterface Defines an interface for entity handlers that expose contexts.