You are here

protected function AddVariantContextsForm::isEditableContext in Page Manager 8

Same name and namespace in other branches
  1. 8.4 page_manager_ui/src/Form/AddVariantContextsForm.php \Drupal\page_manager_ui\Form\AddVariantContextsForm::isEditableContext()

Parameters

mixed $cached_values:

string $row:

Return value

bool

Overrides ManageContext::isEditableContext

File

page_manager_ui/src/Form/AddVariantContextsForm.php, line 121
Contains \Drupal\page_manager_ui\Form\AddVariantContextsForm.

Class

AddVariantContextsForm

Namespace

Drupal\page_manager_ui\Form

Code

protected function isEditableContext($cached_values, $row) {

  /** @var \Drupal\page_manager\PageVariantInterface $page_variant */
  $page_variant = $cached_values['page_variant'];
  $page = $page_variant
    ->getPage();
  return empty($page
    ->getContexts()[$row]) && !empty($page_variant
    ->getContexts()[$row]);
}