AddVariantSelectionConfigure.php in Page Manager 8.4
File
page_manager_ui/src/Form/AddVariantSelectionConfigure.php
View source
<?php
namespace Drupal\page_manager_ui\Form;
use Drupal\ctools\Form\ConditionConfigure;
class AddVariantSelectionConfigure extends ConditionConfigure {
protected function getPageVariant($cached_values) {
return $cached_values['page_variant'];
}
protected function getParentRouteInfo($cached_values) {
$page_variant = $this
->getPageVariant($cached_values);
return [
'entity.page_variant.add_step_form',
[
'page' => $page_variant
->getPage()
->id(),
'machine_name' => $this->machine_name,
'step' => 'selection',
],
];
}
protected function getConditions($cached_values) {
$page_variant = $this
->getPageVariant($cached_values);
return $page_variant
->get('selection_criteria');
}
protected function setConditions($cached_values, $conditions) {
$page_variant = $this
->getPageVariant($cached_values);
$page_variant
->set('selection_criteria', $conditions);
return $cached_values;
}
protected function getContexts($cached_values) {
$page_variant = $this
->getPageVariant($cached_values);
return $page_variant
->getContexts();
}
}