ILIAS  release_7 Revision v7.30-3-g800a261c036
ILIAS\HTTP\Cookies\CookieWrapper Class Reference
+ Inheritance diagram for ILIAS\HTTP\Cookies\CookieWrapper:
+ Collaboration diagram for ILIAS\HTTP\Cookies\CookieWrapper:

Public Member Functions

 __construct (SetCookie $cookie)
 CookieFacade constructor. More...
 
 getName ()
 @inheritDoc More...
 
 getValue ()
 @inheritDoc More...
 
 getExpires ()
 @inheritDoc More...
 
 getMaxAge ()
 @inheritDoc More...
 
 getPath ()
 @inheritDoc More...
 
 getDomain ()
 @inheritDoc More...
 
 getSecure ()
 @inheritDoc More...
 
 getHttpOnly ()
 @inheritDoc More...
 
 withValue (string $value=null)
 @inheritDoc More...
 
 withExpires ($expires=null)
 @inheritDoc More...
 
 rememberForLongTime ()
 @inheritDoc More...
 
 expire ()
 @inheritDoc More...
 
 withMaxAge (int $maxAge=null)
 @inheritDoc More...
 
 withPath (string $path=null)
 @inheritDoc More...
 
 withDomain (string $domain=null)
 @inheritDoc More...
 
 withSecure (bool $secure=null)
 @inheritDoc More...
 
 withHttpOnly (bool $httpOnly=null)
 @inheritDoc More...
 
 __toString ()
 @inheritDoc More...
 
 getImplementation ()
 Returns the underlying implementation. More...
 
 getName ()
 Cookie name. More...
 
 getValue ()
 Cookie value. More...
 
 getExpires ()
 Expiration date as unix timestamp. More...
 
 getMaxAge ()
 Max age measured in seconds. More...
 
 getPath ()
 Cookie path. More...
 
 getDomain ()
 Cookie domain. More...
 
 getSecure ()
 True if it's secure cookie otherwise false. More...
 
 getHttpOnly ()
 True if the cookie is http only otherwise false. More...
 
 withValue (string $value=null)
 Sets the cookie value. More...
 
 withExpires ($expires=null)
 Sets the expiration date of the cookie. More...
 
 rememberForLongTime ()
 Sets the expiration date to +5 years. More...
 
 expire ()
 Expire the cookie. More...
 
 withMaxAge (int $maxAge=null)
 Maximal life time of the cookie in seconds. More...
 
 withPath (string $path=null)
 Sets the cookie path. More...
 
 withDomain (string $domain=null)
 Sets the domain name for the cookie. More...
 
 withSecure (bool $secure=null)
 Sets if the cookie is a secure cookie or not. More...
 
 withHttpOnly (bool $httpOnly=null)
 Sets if the cookie is http only. More...
 
 __toString ()
 Returns the string representation of the object. More...
 

Private Attributes

 $cookie
 Underlying implementation. More...
 

Detailed Description

Definition at line 17 of file CookieWrapper.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\HTTP\Cookies\CookieWrapper::__construct ( SetCookie  $cookie)

CookieFacade constructor.

Parameters
SetCookie$cookie

Definition at line 33 of file CookieWrapper.php.

34 {
35 $this->cookie = $cookie;
36 }
$cookie
Underlying implementation.

References ILIAS\HTTP\Cookies\CookieWrapper\$cookie.

Member Function Documentation

◆ __toString()

ILIAS\HTTP\Cookies\CookieWrapper::__toString ( )

@inheritDoc

Implements ILIAS\HTTP\Cookies\Cookie.

Definition at line 222 of file CookieWrapper.php.

222 : string
223 {
224 return $this->cookie->__toString();
225 }

◆ expire()

ILIAS\HTTP\Cookies\CookieWrapper::expire ( )

@inheritDoc

Implements ILIAS\HTTP\Cookies\Cookie.

Definition at line 150 of file CookieWrapper.php.

151 {
152 $clone = clone $this;
153 $clone->cookie = $this->cookie->expire();
154
155 return $clone;
156 }
expire()
Expire the cookie.

References ILIAS\HTTP\Cookies\Cookie\expire().

+ Here is the call graph for this function:

◆ getDomain()

ILIAS\HTTP\Cookies\CookieWrapper::getDomain ( )

@inheritDoc

Implements ILIAS\HTTP\Cookies\Cookie.

Definition at line 87 of file CookieWrapper.php.

87 : ?string
88 {
89 return $this->cookie->getDomain();
90 }

◆ getExpires()

ILIAS\HTTP\Cookies\CookieWrapper::getExpires ( )

@inheritDoc

Implements ILIAS\HTTP\Cookies\Cookie.

Definition at line 60 of file CookieWrapper.php.

60 : int
61 {
62 return $this->cookie->getExpires();
63 }

◆ getHttpOnly()

ILIAS\HTTP\Cookies\CookieWrapper::getHttpOnly ( )

@inheritDoc

Implements ILIAS\HTTP\Cookies\Cookie.

Definition at line 105 of file CookieWrapper.php.

105 : bool
106 {
107 return $this->cookie->getHttpOnly();
108 }

◆ getImplementation()

ILIAS\HTTP\Cookies\CookieWrapper::getImplementation ( )

Returns the underlying implementation.

Only for package/service internal use!!!

Returns
SetCookie

Definition at line 235 of file CookieWrapper.php.

236 {
237 return $this->cookie;
238 }

References ILIAS\HTTP\Cookies\CookieWrapper\$cookie.

◆ getMaxAge()

ILIAS\HTTP\Cookies\CookieWrapper::getMaxAge ( )

@inheritDoc

Implements ILIAS\HTTP\Cookies\Cookie.

Definition at line 69 of file CookieWrapper.php.

69 : int
70 {
71 return $this->cookie->getMaxAge();
72 }

◆ getName()

ILIAS\HTTP\Cookies\CookieWrapper::getName ( )

@inheritDoc

Implements ILIAS\HTTP\Cookies\Cookie.

Definition at line 42 of file CookieWrapper.php.

42 : string
43 {
44 return $this->cookie->getName();
45 }

◆ getPath()

ILIAS\HTTP\Cookies\CookieWrapper::getPath ( )

@inheritDoc

Implements ILIAS\HTTP\Cookies\Cookie.

Definition at line 78 of file CookieWrapper.php.

78 : ?string
79 {
80 return $this->cookie->getPath();
81 }

◆ getSecure()

ILIAS\HTTP\Cookies\CookieWrapper::getSecure ( )

@inheritDoc

Implements ILIAS\HTTP\Cookies\Cookie.

Definition at line 96 of file CookieWrapper.php.

96 : bool
97 {
98 return $this->cookie->getSecure();
99 }

◆ getValue()

ILIAS\HTTP\Cookies\CookieWrapper::getValue ( )

@inheritDoc

Implements ILIAS\HTTP\Cookies\Cookie.

Definition at line 51 of file CookieWrapper.php.

51 : ?string
52 {
53 return $this->cookie->getValue();
54 }

◆ rememberForLongTime()

ILIAS\HTTP\Cookies\CookieWrapper::rememberForLongTime ( )

@inheritDoc

Implements ILIAS\HTTP\Cookies\Cookie.

Definition at line 138 of file CookieWrapper.php.

139 {
140 $clone = clone $this;
141 $clone->cookie = $this->cookie->rememberForever();
142
143 return $clone;
144 }

◆ withDomain()

ILIAS\HTTP\Cookies\CookieWrapper::withDomain ( string  $domain = null)

@inheritDoc

Implements ILIAS\HTTP\Cookies\Cookie.

Definition at line 186 of file CookieWrapper.php.

187 {
188 $clone = clone $this;
189 $clone->cookie = $this->cookie->withDomain($domain);
190
191 return $clone;
192 }
withDomain(string $domain=null)
Sets the domain name for the cookie.

References ILIAS\HTTP\Cookies\Cookie\withDomain().

+ Here is the call graph for this function:

◆ withExpires()

ILIAS\HTTP\Cookies\CookieWrapper::withExpires (   $expires = null)

@inheritDoc

Implements ILIAS\HTTP\Cookies\Cookie.

Definition at line 126 of file CookieWrapper.php.

127 {
128 $clone = clone $this;
129 $clone->cookie = $this->cookie->withExpires($expires);
130
131 return $clone;
132 }
withExpires($expires=null)
Sets the expiration date of the cookie.

References ILIAS\HTTP\Cookies\Cookie\withExpires().

+ Here is the call graph for this function:

◆ withHttpOnly()

ILIAS\HTTP\Cookies\CookieWrapper::withHttpOnly ( bool  $httpOnly = null)

@inheritDoc

Implements ILIAS\HTTP\Cookies\Cookie.

Definition at line 210 of file CookieWrapper.php.

211 {
212 $clone = clone $this;
213 $clone->cookie = $this->cookie->withHttpOnly($httpOnly);
214
215 return $clone;
216 }
withHttpOnly(bool $httpOnly=null)
Sets if the cookie is http only.

References ILIAS\HTTP\Cookies\Cookie\withHttpOnly().

+ Here is the call graph for this function:

◆ withMaxAge()

ILIAS\HTTP\Cookies\CookieWrapper::withMaxAge ( int  $maxAge = null)

@inheritDoc

Implements ILIAS\HTTP\Cookies\Cookie.

Definition at line 162 of file CookieWrapper.php.

163 {
164 $clone = clone $this;
165 $clone->cookie = $this->cookie->withMaxAge($maxAge);
166
167 return $clone;
168 }
withMaxAge(int $maxAge=null)
Maximal life time of the cookie in seconds.

References ILIAS\HTTP\Cookies\Cookie\withMaxAge().

+ Here is the call graph for this function:

◆ withPath()

ILIAS\HTTP\Cookies\CookieWrapper::withPath ( string  $path = null)

@inheritDoc

Implements ILIAS\HTTP\Cookies\Cookie.

Definition at line 174 of file CookieWrapper.php.

175 {
176 $clone = clone $this;
177 $clone->cookie = $this->cookie->withPath($path);
178
179 return $clone;
180 }
withPath(string $path=null)
Sets the cookie path.

References ILIAS\HTTP\Cookies\Cookie\withPath().

+ Here is the call graph for this function:

◆ withSecure()

ILIAS\HTTP\Cookies\CookieWrapper::withSecure ( bool  $secure = null)

@inheritDoc

Implements ILIAS\HTTP\Cookies\Cookie.

Definition at line 198 of file CookieWrapper.php.

199 {
200 $clone = clone $this;
201 $clone->cookie = $this->cookie->withSecure($secure);
202
203 return $clone;
204 }
withSecure(bool $secure=null)
Sets if the cookie is a secure cookie or not.

References ILIAS\HTTP\Cookies\Cookie\withSecure().

+ Here is the call graph for this function:

◆ withValue()

ILIAS\HTTP\Cookies\CookieWrapper::withValue ( string  $value = null)

@inheritDoc

Implements ILIAS\HTTP\Cookies\Cookie.

Definition at line 114 of file CookieWrapper.php.

115 {
116 $clone = clone $this;
117 $clone->cookie = $this->cookie->withValue($value);
118
119 return $clone;
120 }
withValue(string $value=null)
Sets the cookie value.

References ILIAS\HTTP\Cookies\Cookie\withValue().

+ Here is the call graph for this function:

Field Documentation

◆ $cookie

SetCookie ILIAS\HTTP\Cookies\CookieWrapper::$cookie
private

Underlying implementation.

Definition at line 25 of file CookieWrapper.php.

Referenced by ILIAS\HTTP\Cookies\CookieWrapper\__construct(), and ILIAS\HTTP\Cookies\CookieWrapper\getImplementation().


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