class GingerbreadReturn in Bakery Single Sign-On System 8.2
Hierarchy
- class \Drupal\bakery\Cookies\GingerbreadReturn implements CookieInterface
Expanded class hierarchy of GingerbreadReturn
2 files declare their use of GingerbreadReturn
- GingerbreadReturnTest.php in tests/
src/ Unit/ Cookies/ GingerbreadReturnTest.php - MainController.php in src/
Controller/ MainController.php - Router call back functions for bakery SSO functions.
File
- src/
Cookies/ GingerbreadReturn.php, line 5
Namespace
Drupal\bakery\CookiesView source
class GingerbreadReturn implements CookieInterface {
/**
* @var string
*/
protected $name;
/**
* @var string
*/
protected $mail;
/**
* For use in slave init field.
*
* @var string
*/
protected $uid;
/**
* @var array|mixed
*/
private $extra;
public final function __construct($name, $mail, $uid, $extra = []) {
$this->name = $name;
$this->mail = $mail;
$this->uid = $uid;
$this->extra = $extra;
}
/**
* {@inheritDoc}
*/
public static function fromData(array $data) {
return new static($data['name'] ?? '', $data['mail'] ?? '', $data['uid'] ?? '');
}
public function toData() : array {
$data = [];
foreach ($this->extra as $k => $v) {
$data[$k] = $v;
}
return [
'name' => $this->name,
'mail' => $this->mail,
'uid' => $this->uid,
] + $data;
}
public static function getName() : string {
return 'gingerbread';
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
GingerbreadReturn:: |
private | property | ||
GingerbreadReturn:: |
protected | property | ||
GingerbreadReturn:: |
protected | property | ||
GingerbreadReturn:: |
protected | property | For use in slave init field. | |
GingerbreadReturn:: |
public static | function |
Create from data stored in a cookie. Overrides CookieInterface:: |
|
GingerbreadReturn:: |
public static | function |
Get the cookie name/type. Overrides CookieInterface:: |
|
GingerbreadReturn:: |
public | function |
Convert the data into an array to be stored into a cookie. Overrides CookieInterface:: |
|
GingerbreadReturn:: |
final public | function |