trait BrowserCookieTrait in Bakery Single Sign-On System 8.2
Hierarchy
- trait \Drupal\bakery\Cookies\BrowserCookieTrait
1 file declares its use of BrowserCookieTrait
- BrowserCookieTraitTest.php in tests/
src/ Unit/ Cookies/ BrowserCookieTraitTest.php
File
- src/
Cookies/ BrowserCookieTrait.php, line 8
Namespace
Drupal\bakery\CookiesView source
trait BrowserCookieTrait {
/**
* Helper to determine if the current site is the "main" site.
*/
protected function getIsMain() : bool {
return static::getBakeryService()
->isMain();
}
/**
* Wrap cookie name for browser.
*/
protected static function cookieName(string $type) : string {
return static::getBakeryKitchen()
->cookieName($type);
}
/**
* Get a bakery service.
*/
private static function getBakeryService() : BakeryService {
return \Drupal::service('bakery.bakery_service');
}
/**
* Get a kitchen.
*/
private static function getBakeryKitchen() : Kitchen {
return \Drupal::service('bakery.kitchen');
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
BrowserCookieTrait:: |
protected static | function | Wrap cookie name for browser. | |
BrowserCookieTrait:: |
private static | function | Get a kitchen. | |
BrowserCookieTrait:: |
private static | function | Get a bakery service. | |
BrowserCookieTrait:: |
protected | function | Helper to determine if the current site is the "main" site. |