You are here

public function OatmealCookie::toData in Bakery Single Sign-On System 8.2

Convert the data into an array to be stored into a cookie.

Return value

array The data to store in the cookie.

Overrides CookieInterface::toData

File

src/Cookies/OatmealCookie.php, line 40

Class

OatmealCookie

Namespace

Drupal\bakery\Cookies

Code

public function toData() : array {
  $main = $this->isMain ?? $this
    ->getIsMain();
  $tmp = [
    'name' => $this->name,
    'data' => $this->data,
    'master' => (int) $main,
    'calories' => $this->calories,
  ];
  if (!$main) {
    global $base_url;
    $tmp['slave'] = $base_url . '/';
  }
  return $tmp;
}