ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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

 $cookies
 

Detailed Description

Definition at line 18 of file CookieJarWrapper.php.

Constructor & Destructor Documentation

◆ __construct()

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

CookieJarWrapper constructor.

Parameters
SetCookies$cookies

Definition at line 32 of file CookieJarWrapper.php.

33 {
34 $this->cookies = $cookies;
35 }

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 50 of file CookieJarWrapper.php.

51 {
52 $cookie = $this->cookies->get($name);
53
54 return (is_null($cookie)) ? null : new CookieWrapper($cookie);
55 }
if($format !==null) $name
Definition: metadata.php:230

References $name.

◆ getAll()

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

@inheritDoc

Implements ILIAS\HTTP\Cookies\CookieJar.

Definition at line 61 of file CookieJarWrapper.php.

61 : array
62 {
63 $wrappedCookies = [];
64 foreach ($this->cookies->getAll() as $cookie) {
65 $wrappedCookies[] = new CookieWrapper($cookie);
66 }
67
68 return $wrappedCookies;
69 }

◆ has()

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

@inheritDoc

Implements ILIAS\HTTP\Cookies\CookieJar.

Definition at line 41 of file CookieJarWrapper.php.

41 : bool
42 {
43 return $this->cookies->has($name);
44 }

References $name.

◆ renderIntoResponseHeader()

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

@inheritDoc

Implements ILIAS\HTTP\Cookies\CookieJar.

Definition at line 105 of file CookieJarWrapper.php.

105 : \Psr\Http\Message\ResponseInterface
106 {
107 $response = $this->cookies->renderIntoSetCookieHeader($response);
108
109 return $response;
110 }
$response

References $response.

◆ without()

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

@inheritDoc

Implements ILIAS\HTTP\Cookies\CookieJar.

Definition at line 93 of file CookieJarWrapper.php.

94 {
95 $clone = clone $this;
96 $clone->cookies = $this->cookies->without($name);
97
98 return $clone;
99 }
without(string $name)
Creates a cookie jar without the specified cookie.

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: