Gingerbread.php in Bakery Single Sign-On System 8.2
File
src/Cookies/Gingerbread.php
View source
<?php
namespace Drupal\bakery\Cookies;
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;
}
public static function fromData(array $data) {
return new static($data['name'], $data['or_email'], $data['slave'], $data['uid']);
}
public function toData() : array {
return [
'name' => $this->name,
'or_email' => $this->or_email,
'slave' => $this->child,
'uid' => $this->uid,
];
}
public static function getName() : string {
return 'gingerbread';
}
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;
}
}