public function PanelsStorageManager::save in Panels 8.4
Same name and namespace in other branches
- 8.3 src/Storage/PanelsStorageManager.php \Drupal\panels\Storage\PanelsStorageManager::save()
Saves a Panels display.
Parameters
\Drupal\panels\Plugin\DisplayVariant\PanelsDisplayVariant $panels_display: The Panels display to save. $panels_display->getStorageType() and $panels_display->getStorageId() must return the storage type and id as known to the storage plugin.
Throws
\Exception If $panels->getStorageType() or $panels->getStorageId() aren't set, the storage plugin can't be found, or there is no Panels display found in the storage plugin with the given id.
Overrides PanelsStorageManagerInterface::save
File
- src/
Storage/ PanelsStorageManager.php, line 97
Class
- PanelsStorageManager
- Panels storage manager service.
Namespace
Drupal\panels\StorageCode
public function save(PanelsDisplayVariant $panels_display) {
// Allow event subscribers to react to the variant being saved.
$event = new PanelsVariantEvent($panels_display);
$this->eventDispatcher
->dispatch(PanelsEvents::VARIANT_PRE_SAVE, $event);
$storage = $this
->getStorage($panels_display
->getStorageType());
$storage
->save($panels_display);
$this->eventDispatcher
->dispatch(PanelsEvents::VARIANT_POST_SAVE, $event);
}