You are here

class Stroopwafel in Bakery Single Sign-On System 8.2

Hierarchy

Expanded class hierarchy of Stroopwafel

4 files declare their use of Stroopwafel
BakeryUserHooks.php in src/BakeryUserHooks.php
ChildController.php in src/Controller/ChildController.php
KitchenTest.php in tests/src/Unit/KitchenTest.php
StroopwafelTest.php in tests/src/Unit/Cookies/StroopwafelTest.php

File

src/Cookies/Stroopwafel.php, line 5

Namespace

Drupal\bakery\Cookies
View source
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;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Stroopwafel::$data private property
Stroopwafel::$uid private property
Stroopwafel::fromData public static function Create from data stored in a cookie. Overrides CookieInterface::fromData
Stroopwafel::getData public function
Stroopwafel::getName public static function Get the cookie name/type. Overrides CookieInterface::getName
Stroopwafel::getPath public function Gets the remote path to deliver cookies too. Overrides RemoteCookieInterface::getPath
Stroopwafel::getUid public function
Stroopwafel::toData public function Convert the data into an array to be stored into a cookie. Overrides CookieInterface::toData
Stroopwafel::__construct final public function