You are here

public function PanelsIPEPageController::cancel in Panels 8.4

Same name and namespace in other branches
  1. 8.3 panels_ipe/src/Controller/PanelsIPEPageController.php \Drupal\panels_ipe\Controller\PanelsIPEPageController::cancel()

Removes any temporary changes to the variant.

Parameters

string $panels_storage_type: The id of the storage plugin.

string $panels_storage_id: The id within the storage plugin for the requested Panels display.

Return value

\Symfony\Component\HttpFoundation\JsonResponse

Throws

\Drupal\Core\TempStore\SharedTempStore

1 string reference to 'PanelsIPEPageController::cancel'
panels_ipe.routing.yml in panels_ipe/panels_ipe.routing.yml
panels_ipe/panels_ipe.routing.yml

File

panels_ipe/src/Controller/PanelsIPEPageController.php, line 141

Class

PanelsIPEPageController
Contains all JSON endpoints required for Panels IPE + Page Manager.

Namespace

Drupal\panels_ipe\Controller

Code

public function cancel($panels_storage_type, $panels_storage_id) {
  $panels_display = $this
    ->loadPanelsDisplay($panels_storage_type, $panels_storage_id);

  // If a temporary configuration for this variant exists, use it.
  $temp_store_key = $panels_display
    ->getTempStoreId();
  if ($variant_config = $this->tempStore
    ->get($temp_store_key)) {
    $this->tempStore
      ->delete($temp_store_key);
  }

  // Return an empty JSON response.
  return new JsonResponse();
}