You are here

public function PanelizerDefaultPanelsStorage::save in Panelizer 8.4

Same name and namespace in other branches
  1. 8.5 src/Plugin/PanelsStorage/PanelizerDefaultPanelsStorage.php \Drupal\panelizer\Plugin\PanelsStorage\PanelizerDefaultPanelsStorage::save()
  2. 8.3 src/Plugin/PanelsStorage/PanelizerDefaultPanelsStorage.php \Drupal\panelizer\Plugin\PanelsStorage\PanelizerDefaultPanelsStorage::save()

File

src/Plugin/PanelsStorage/PanelizerDefaultPanelsStorage.php, line 155

Class

PanelizerDefaultPanelsStorage
Panels storage service that stores Panels displays in Panelizer defaults.

Namespace

Drupal\panelizer\Plugin\PanelsStorage

Code

public function save(PanelsDisplayVariant $panels_display) {
  $id = $panels_display
    ->getStorageId();
  try {
    list($entity_type_id, $bundle, $view_mode, $name) = $this
      ->parseId($id);
    $this->panelizer
      ->setDefaultPanelsDisplay($name, $entity_type_id, $bundle, $view_mode, $panels_display);
  } catch (PanelizerException $e) {
    throw new \Exception("Couldn't find Panelizer default to store Panels display");
  }
}