You are here

public function ContentModerationIPEAccess::applies in Lightning Workflow 8.3

Same name and namespace in other branches
  1. 8 src/Plugin/IPEAccess/ContentModerationIPEAccess.php \Drupal\lightning_workflow\Plugin\IPEAccess\ContentModerationIPEAccess::applies()
  2. 8.2 src/Plugin/IPEAccess/ContentModerationIPEAccess.php \Drupal\lightning_workflow\Plugin\IPEAccess\ContentModerationIPEAccess::applies()

File

src/Plugin/IPEAccess/ContentModerationIPEAccess.php, line 67

Class

ContentModerationIPEAccess
Provides Panels IPE access logic for Content Moderation integration.

Namespace

Drupal\lightning_workflow\Plugin\IPEAccess

Code

public function applies(PanelsDisplayVariant $display) {
  $contexts = $display
    ->getContexts();
  if (empty($contexts['@panelizer.entity_context:entity'])) {
    return FALSE;
  }
  $context = $contexts['@panelizer.entity_context:entity'];
  if ($context
    ->hasContextValue()) {
    return $this->information
      ->isModeratedEntity($context
      ->getContextValue());
  }
  else {
    return FALSE;
  }
}