\app\framework\Component\Route\Klein\DataCollectionResponseCookieDataCollection

ResponseCookieDataCollection

A DataCollection for HTTP response cookies

Summary

Methods
Properties
Constants
__construct()
keys()
all()
get()
set()
replace()
merge()
exists()
remove()
clear()
isEmpty()
cloneEmpty()
__get()
__set()
__isset()
__unset()
getIterator()
offsetGet()
offsetSet()
offsetExists()
offsetUnset()
count()
No public properties found
No constants found
No protected methods found
$attributes
N/A
No private methods found
No private properties found
N/A

Properties

$attributes

$attributes : 

Collection of data attributes

Type

Methods

__construct()

__construct(array  $cookies = array()) 

Constructor

Parameters

array $cookies

The cookies of this collection

keys()

keys(array  $mask = null, boolean  $fill_with_nulls = true) : array

Returns all of the key names in the collection

If an optional mask array is passed, this only returns the keys that match the mask

Parameters

array $mask

The parameter mask array

boolean $fill_with_nulls

Whether or not to fill the returned array with values to match the given mask, even if they don't exist in the collection

Returns

array

all()

all(array  $mask = null, boolean  $fill_with_nulls = true) : array

Returns all of the attributes in the collection

If an optional mask array is passed, this only returns the keys that match the mask

Parameters

array $mask

The parameter mask array

boolean $fill_with_nulls

Whether or not to fill the returned array with values to match the given mask, even if they don't exist in the collection

Returns

array

get()

get(string  $key, mixed  $default_val = null) : mixed

Return an attribute of the collection

Return a default value if the key doesn't exist

Parameters

string $key

The name of the parameter to return

mixed $default_val

The default value of the parameter if it contains no value

Returns

mixed

set()

set(string  $key, \app\framework\Component\Route\Klein\ResponseCookie|string  $value) : \app\framework\Component\Route\Klein\DataCollection\ResponseCookieDataCollection

Set a cookie

A value may either be a string or a ResponseCookie instance String values will be converted into a ResponseCookie with the "name" of the cookie being set from the "key"

Obviously, the developer is free to organize this collection however they like, and can be more explicit by passing a more suggested "$key" as the cookie's "domain" and passing in an instance of a ResponseCookie as the "$value"

Parameters

string $key

The name of the cookie to set

\app\framework\Component\Route\Klein\ResponseCookie|string $value

The value of the cookie to set

Returns

\app\framework\Component\Route\Klein\DataCollection\ResponseCookieDataCollection

merge()

merge(array  $attributes = array(), boolean  $hard = false) : \app\framework\Component\Route\Klein\DataCollection\DataCollection

Merge attributes with the collection's attributes

Optionally allows a second boolean parameter to merge the attributes into the collection in a "hard" manner, using the "array_replace" method instead of the usual "array_merge" method

Parameters

array $attributes

The attributes to merge into the collection

boolean $hard

Whether or not to make the merge "hard"

Returns

\app\framework\Component\Route\Klein\DataCollection\DataCollection

exists()

exists(string  $key) : boolean

See if an attribute exists in the collection

Parameters

string $key

The name of the parameter

Returns

boolean

remove()

remove(string  $key) : void

Remove an attribute from the collection

Parameters

string $key

The name of the parameter

isEmpty()

isEmpty() : boolean

Check if the collection is empty

Returns

boolean

__get()

__get(string  $key) : mixed

Magic "__get" method

Allows the ability to arbitrarily request an attribute from this instance while treating it as an instance property

Parameters

string $key

The name of the parameter to return

Returns

mixed

__set()

__set(string  $key, mixed  $value) : void

Magic "__set" method

Allows the ability to arbitrarily set an attribute from this instance while treating it as an instance property

Parameters

string $key

The name of the parameter to set

mixed $value

The value of the parameter to set

__isset()

__isset(string  $key) : boolean

Magic "__isset" method

Allows the ability to arbitrarily check the existence of an attribute from this instance while treating it as an instance property

Parameters

string $key

The name of the parameter

Returns

boolean

__unset()

__unset(string  $key) : void

Magic "__unset" method

Allows the ability to arbitrarily remove an attribute from this instance while treating it as an instance property

Parameters

string $key

The name of the parameter

getIterator()

getIterator() : \ArrayIterator

Get the aggregate iterator

IteratorAggregate interface required method

Returns

\ArrayIterator

offsetGet()

offsetGet(string  $key) : mixed

Get an attribute via array syntax

Allows the access of attributes of this instance while treating it like an array

Parameters

string $key

The name of the parameter to return

Returns

mixed

offsetSet()

offsetSet(string  $key, mixed  $value) : void

Set an attribute via array syntax

Allows the access of attributes of this instance while treating it like an array

Parameters

string $key

The name of the parameter to set

mixed $value

The value of the parameter to set

offsetExists()

offsetExists(string  $key) : boolean

Check existence an attribute via array syntax

Allows the access of attributes of this instance while treating it like an array

Parameters

string $key

The name of the parameter

Returns

boolean

offsetUnset()

offsetUnset(string  $key) : void

Remove an attribute via array syntax

Allows the access of attributes of this instance while treating it like an array

Parameters

string $key

The name of the parameter

count()

count() : integer

Count the attributes via a simple "count" call

Allows the use of the "count" function (or any internal counters) to simply count the number of attributes in the collection.

Returns

integer