\ptejada\uFlexSession

Class to handle the PHP session The entire PHP session can be handled Or a direct member of the main session array which is refer as a namespace

Summary

Methods
Properties
Constants
__construct()
update()
toArray()
isEmpty()
filter()
get()
set()
count()
__get()
__set()
__isset()
__unset()
getID()
destroy()
$log
No constants found
No protected methods found
$_data
$namespace
N/A
validate()
No private properties found
N/A

Properties

$_data

$_data : array

Type

array — The underlying original array

$namespace

$namespace : null|string

Type

null|string — Session index to manage

Methods

__construct()

__construct(string $namespace, \ptejada\uFlex\Log $log)

Initialize a session handler by namespace

Parameters

string $namespace
  • Session namespace to manage
\ptejada\uFlex\Log $log

update()

update(array $updates)

Update the collection with a given array of updates

Parameters

array $updates

toArray()

toArray() : array

Return the raw underling array of the collection

Returns

array

isEmpty()

isEmpty() : bool

Checks if the collection is empty

Returns

bool

filter()

filter()

Reduces the collection to only include allowed fields Every argument passed to this function is considered a field

get()

get(string $keyPath) : mixed|null|\ptejada\uFlex\Collection

Get a value of an entry in the collection Useful to get deep array elements without manually dealing with errors During the process

Parameters

string $keyPath
  • the period delimited location

Returns

mixed|null|\ptejada\uFlex\Collection

set()

set(string $keyPath, string $value)

Set a value to an index in the collection Used when the collection are nested

Parameters

string $keyPath
string $value

count()

count() : int

Return the number of items in the collection

Returns

int

__get()

__get(string $name) : mixed|\ptejada\uFlex\LinkedCollection

Magic getter for all first child properties

Parameters

string $name

Returns

mixed|\ptejada\uFlex\LinkedCollection

__set()

__set(string $name, string $value)

Magic setter for all first child properties

Parameters

string $name
string $value

__isset()

__isset(string $name) : bool

Check a property exists

Parameters

string $name

Returns

bool

__unset()

__unset(string $name)

Deletes a property from the collection

Parameters

string $name

getID()

getID() : string

Get current session ID identifier

Returns

string

destroy()

destroy()

Empty the session namespace

validate()

validate()

Validates the session