ILIAS  release_8 Revision v8.24
ILIAS\HTTP\Cookies\CookieJarWrapper Class Reference
+ Inheritance diagram for ILIAS\HTTP\Cookies\CookieJarWrapper:
+ Collaboration diagram for ILIAS\HTTP\Cookies\CookieJarWrapper:

Public Member Functions

 __construct (SetCookies $cookies)
 CookieJarWrapper constructor. More...
 
 has (string $name)
 @inheritDoc More...
 
 get (string $name)
 @inheritDoc More...
 
 getAll ()
 @inheritDoc More...
 
 without (string $name)
 @inheritDoc More...
 
 renderIntoResponseHeader (ResponseInterface $response)
 @inheritDoc More...
 
- Public Member Functions inherited from ILIAS\HTTP\Cookies\CookieJar
 has (string $name)
 Checks if a cookie with the given name is in the jar. More...
 
 get (string $name)
 Fetches the cookie with the given name from the current jar. More...
 
 getAll ()
 Fetches all cookies from the current jar. More...
 
 with (Cookie $setCookie)
 Creates a new cookie jar with the given cookie. More...
 
 without (string $name)
 Creates a cookie jar without the specified cookie. More...
 
 renderIntoResponseHeader (ResponseInterface $response)
 Render CookieJar into a Response. More...
 

Private Attributes

SetCookies $cookies
 

Detailed Description

Definition at line 31 of file CookieJarWrapper.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\HTTP\Cookies\CookieJarWrapper::__construct ( SetCookies  $cookies)

CookieJarWrapper constructor.

Definition at line 39 of file CookieJarWrapper.php.

40 {
41 $this->cookies = $cookies;
42 }

References ILIAS\HTTP\Cookies\CookieJarWrapper\$cookies.

Member Function Documentation

◆ get()

ILIAS\HTTP\Cookies\CookieJarWrapper::get ( string  $name)

@inheritDoc

Implements ILIAS\HTTP\Cookies\CookieJar.

Definition at line 57 of file CookieJarWrapper.php.

58 {
59 $cookie = $this->cookies->get($name);
60
61 return (is_null($cookie)) ? null : new CookieWrapper($cookie);
62 }
if($format !==null) $name
Definition: metadata.php:247

References $name.

◆ getAll()

ILIAS\HTTP\Cookies\CookieJarWrapper::getAll ( )

@inheritDoc

Implements ILIAS\HTTP\Cookies\CookieJar.

Definition at line 68 of file CookieJarWrapper.php.

68 : array
69 {
70 $wrappedCookies = [];
71 foreach ($this->cookies->getAll() as $cookie) {
72 $wrappedCookies[] = new CookieWrapper($cookie);
73 }
74
75 return $wrappedCookies;
76 }

◆ has()

ILIAS\HTTP\Cookies\CookieJarWrapper::has ( string  $name)

@inheritDoc

Implements ILIAS\HTTP\Cookies\CookieJar.

Definition at line 48 of file CookieJarWrapper.php.

48 : bool
49 {
50 return $this->cookies->has($name);
51 }

References $name.

◆ renderIntoResponseHeader()

ILIAS\HTTP\Cookies\CookieJarWrapper::renderIntoResponseHeader ( ResponseInterface  $response)

@inheritDoc

Implements ILIAS\HTTP\Cookies\CookieJar.

Definition at line 112 of file CookieJarWrapper.php.

112 : ResponseInterface
113 {
114 return $this->cookies->renderIntoSetCookieHeader($response);
115 }
$response

References $response.

◆ without()

ILIAS\HTTP\Cookies\CookieJarWrapper::without ( string  $name)

@inheritDoc

Implements ILIAS\HTTP\Cookies\CookieJar.

Definition at line 100 of file CookieJarWrapper.php.

100 : CookieJar
101 {
102 $clone = clone $this;
103 $clone->cookies = $this->cookies->without($name);
104
105 return $clone;
106 }

References $name, and ILIAS\HTTP\Cookies\CookieJar\without().

+ Here is the call graph for this function:

Field Documentation

◆ $cookies

SetCookies ILIAS\HTTP\Cookies\CookieJarWrapper::$cookies
private

The documentation for this class was generated from the following file: