You are here

public function BehaviorSettings::setRedirectPath in Rabbit Hole 8

Same name and namespace in other branches
  1. 2.x src/Entity/BehaviorSettings.php \Drupal\rabbit_hole\Entity\BehaviorSettings::setRedirectPath()

Set the redirect path if action is redirect.

Parameters

string $redirect: The redirect path.

Overrides BehaviorSettingsInterface::setRedirectPath

File

src/Entity/BehaviorSettings.php, line 175

Class

BehaviorSettings
Defines the Behavior settings entity.

Namespace

Drupal\rabbit_hole\Entity

Code

public function setRedirectPath($redirect) {
  if ($this->action !== 'redirect' && $redirect != "") {
    throw new InvalidBehaviorSettingException('redirect');
  }
  $this->redirect = $redirect;
}