You are here

class Gingerbread in Bakery Single Sign-On System 8.2

Hierarchy

Expanded class hierarchy of Gingerbread

6 files declare their use of Gingerbread
BakeryService.php in src/BakeryService.php
Services used in bakery SSO functions.
GingerbreadTest.php in tests/src/Unit/Cookies/GingerbreadTest.php
KitchenTest.php in tests/src/Unit/KitchenTest.php
MainController.php in src/Controller/MainController.php
Router call back functions for bakery SSO functions.
MainSitePagesTest.php in tests/src/Functional/MainSitePagesTest.php

... See full list

File

src/Cookies/Gingerbread.php, line 5

Namespace

Drupal\bakery\Cookies
View source
class Gingerbread implements CookieInterface, RemoteCookieInterface {
  private $name;
  private $or_email;
  private $child;
  private $uid;
  public final function __construct($name, $or_email, $child, $uid) {
    $this->name = $name;
    $this->or_email = $or_email;
    $this->child = $child;
    $this->uid = $uid;
  }

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

  /**
   * {@inheritDoc}
   */
  public function toData() : array {
    return [
      'name' => $this->name,
      'or_email' => $this->or_email,
      // Match slave property are set on the main site.
      'slave' => $this->child,
      'uid' => $this->uid,
    ];
  }

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

  /**
   * {@inheritDoc}
   */
  public function getPath() {
    return 'bakery/create';
  }
  public function getAccountName() {
    return $this->name;
  }
  public function getOrEmail() {
    return $this->or_email;
  }
  public function getChild() {
    return $this->child;
  }
  public function getChildUid() {
    return $this->uid;
  }

}

Members

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