You are here

public function Page::removeParameter in Page Manager 8.4

Same name and namespace in other branches
  1. 8 src/Entity/Page.php \Drupal\page_manager\Entity\Page::removeParameter()

Removes a specific parameter context.

Parameters

string $name: The parameter context's unique machine name.

Return value

$this

Overrides PageInterface::removeParameter

1 call to Page::removeParameter()
Page::filterParameters in src/Entity/Page.php
Filters the parameters to remove any without a valid type.

File

src/Entity/Page.php, line 284

Class

Page
Defines a Page entity class.

Namespace

Drupal\page_manager\Entity

Code

public function removeParameter($name) {
  unset($this->parameters[$name]);

  // Reset contexts when a parameter is removed.
  $this->contexts = [];

  // Reset the contexts of every variant.
  foreach ($this
    ->getVariants() as $page_variant) {
    $page_variant
      ->resetCollectedContexts();
  }
  return $this;
}