1 redirect.class.inc public Redirect::__construct(array $values = array())

Constructor for creating a new redirect.

Parameters

array $values: An array of values to populate the redirect object.

File

core/modules/redirect/redirect.class.inc, line 117

Class

Redirect
Provides a HTTP redirect from one Backdrop internal path to another.

Code

public function __construct(array $values = array()) {
  // Set initial values.
  foreach ($values as $key => $value) {
    $this->$key = $value;
  }

  if (empty($this->rid)) {
    $this->is_new = TRUE;
  }

  // Unserialize the URL option fields.
  if (is_string($this->source_options)) {
    $this->source_options = unserialize($this->source_options);
  }
  if (is_string($this->redirect_options)) {
    $this->redirect_options = unserialize($this->redirect_options);
  }

  module_invoke_all('redirect_prepare', $this, $values);
}