You are here

public function JsonLogData::setLink in JSONlog 8

Same name and namespace in other branches
  1. 8.2 src/Logger/JsonLogData.php \Drupal\jsonlog\Logger\JsonLogData::setLink()
  2. 3.x src/Logger/JsonLogData.php \Drupal\jsonlog\Logger\JsonLogData::setLink()

Parameters

mixed $link:

File

src/Logger/JsonLogData.php, line 183

Class

JsonLogData

Namespace

Drupal\jsonlog\Logger

Code

public function setLink($link) {

  // If link is an integer (or 'integer') it may be an event/error code;
  // the Inspect module exploits link for that purpose.
  if (!$link) {
    $this->link = NULL;
    $this->code = 0;
  }
  elseif (ctype_digit($link)) {
    $this->link = NULL;
    $this->code = (int) $link;
  }
  else {
    $this->link = strip_tags($link);
    $this->code = 0;
  }
}