You are here

public function PanelizerIPEController::revertToDefault in Lightning Workflow 8

Same name and namespace in other branches
  1. 8.3 src/Controller/PanelizerIPEController.php \Drupal\lightning_workflow\Controller\PanelizerIPEController::revertToDefault()
  2. 8.2 src/Controller/PanelizerIPEController.php \Drupal\lightning_workflow\Controller\PanelizerIPEController::revertToDefault()

File

src/Controller/PanelizerIPEController.php, line 49

Class

PanelizerIPEController
Controller for Panels IPE routes that are specific to Panelizer.

Namespace

Drupal\lightning_workflow\Controller

Code

public function revertToDefault(FieldableEntityInterface $entity, $view_mode) {
  if ($this->modInfo
    ->isModeratedEntity($entity)) {
    $entity = $this->modInfo
      ->getLatestRevision($entity
      ->getEntityTypeId(), $entity
      ->id());
  }
  return parent::revertToDefault($entity, $view_mode);
}