class SessionSection implements IteratorAggregate, ArrayAccess

Session section.

Traits

Strict class for better experience.

Properties

bool $warnOnUndefined

Methods

__construct(Session $session, string $name)

Do not call directly. Use Session::getSection().

getIterator()

Returns an iterator over all section variables.

void
__set(string $name, $value)

Sets a variable in this session section.

mixed
__get(string $name)

Gets a variable from this session section.

bool
__isset(string $name)

Determines whether a variable in this session section is set.

void
__unset(string $name)

Unsets a variable in this session section.

void
offsetSet($name, $value)

Sets a variable in this session section.

mixed
offsetGet($name)

Gets a variable from this session section.

bool
offsetExists($name)

Determines whether a variable in this session section is set.

void
offsetUnset($name)

Unsets a variable in this session section.

setExpiration(?string $time, string|string[] $variables = null)

Sets the expiration of the section or specific variables.

void
removeExpiration(string|string[] $variables = null)

Removes the expiration from the section or specific variables.

void
remove()

Cancels the current session section.

Details

at line 41
__construct(Session $session, string $name)

Do not call directly. Use Session::getSection().

Parameters

Session $session
string $name

at line 61
Iterator getIterator()

Returns an iterator over all section variables.

Return Value

Iterator

at line 71
void __set(string $name, $value)

Sets a variable in this session section.

Parameters

string $name
$value

Return Value

void

at line 82
mixed __get(string $name)

Gets a variable from this session section.

Parameters

string $name

Return Value

mixed

at line 96
bool __isset(string $name)

Determines whether a variable in this session section is set.

Parameters

string $name

Return Value

bool

at line 108
void __unset(string $name)

Unsets a variable in this session section.

Parameters

string $name

Return Value

void

at line 118
void offsetSet($name, $value)

Sets a variable in this session section.

Parameters

$name
$value

Return Value

void

at line 128
mixed offsetGet($name)

Gets a variable from this session section.

Parameters

$name

Return Value

mixed

at line 137
bool offsetExists($name)

Determines whether a variable in this session section is set.

Parameters

$name

Return Value

bool

at line 146
void offsetUnset($name)

Unsets a variable in this session section.

Parameters

$name

Return Value

void

at line 158
SessionSection setExpiration(?string $time, string|string[] $variables = null)

Sets the expiration of the section or specific variables.

Parameters

?string $time
string|string[] $variables list of variables / single variable to expire

Return Value

SessionSection

at line 180
void removeExpiration(string|string[] $variables = null)

Removes the expiration from the section or specific variables.

Parameters

string|string[] $variables list of variables / single variable to expire

Return Value

void

at line 192
void remove()

Cancels the current session section.

Return Value

void