You are here

Stroopwafel.php in Bakery Single Sign-On System 8.2

File

src/Cookies/Stroopwafel.php
View source
<?php

namespace Drupal\bakery\Cookies;

class Stroopwafel implements CookieInterface, RemoteCookieInterface {
  private $uid;
  private $data;
  public final function __construct($uid, $data) {
    $this->uid = $uid;
    $this->data = $data;
  }

  /**
   * {@inheritDoc}
   */
  public static function fromData(array $data) {
    return new static($data['uid'], unserialize($data['data']));
  }

  /**
   * {@inheritDoc}
   */
  public function toData() : array {
    return [
      'uid' => $this->uid,
      'category' => 'account',
      'data' => serialize($this->data),
    ];
  }

  /**
   * {@inheritDoc}
   */
  public static function getName() : string {
    return 'stroopwafel';
  }

  /**
   * {@inheritDoc}
   */
  public function getPath() {
    return 'bakery/update';
  }
  public function getUid() {
    return $this->uid;
  }
  public function getData() {
    return $this->data;
  }

}

Classes

Namesort descending Description
Stroopwafel