You are here

public function Page::removeVariant in Page Manager 8.4

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

Removes a specific variant.

Parameters

string $variant_id: The variant ID.

Return value

$this

Overrides PageInterface::removeVariant

File

src/Entity/Page.php, line 405

Class

Page
Defines a Page entity class.

Namespace

Drupal\page_manager\Entity

Code

public function removeVariant($variant_id) {
  $this
    ->getVariant($variant_id)
    ->delete();
  unset($this->variants[$variant_id]);
  return $this;
}