HeaderDataCollection
A DataCollection for HTTP headers
| uses | \Klein\DataCollection\DataCollection |
|---|---|
| package | Klein\DataCollection |
__construct(array $headers)
| override | (doesn't call our parent) |
|---|---|
| access | public |
arrayThe headers of this collection
__get(string $key) : mixed
Allows the ability to arbitrarily request an attribute from this instance while treating it as an instance property
| see | \Klein\DataCollection\get() |
|---|---|
| access | public |
| inherited_from | \Klein\DataCollection\DataCollection::__get() |
stringThe name of the parameter to return
mixed__isset(string $key) : boolean
Allows the ability to arbitrarily check the existence of an attribute from this instance while treating it as an instance property
| see | \Klein\DataCollection\exists() |
|---|---|
| access | public |
| inherited_from | \Klein\DataCollection\DataCollection::__isset() |
stringThe name of the parameter
boolean__set(string $key, mixed $value) : void
Allows the ability to arbitrarily set an attribute from this instance while treating it as an instance property
| see | \Klein\DataCollection\set() |
|---|---|
| access | public |
| inherited_from | \Klein\DataCollection\DataCollection::__set() |
stringThe name of the parameter to set
mixedThe value of the parameter to set
__unset(string $key) : void
Allows the ability to arbitrarily remove an attribute from this instance while treating it as an instance property
| see | \Klein\DataCollection\remove() |
|---|---|
| access | public |
| inherited_from | \Klein\DataCollection\DataCollection::__unset() |
stringThe name of the parameter
all(array $mask, boolean $fill_with_nulls) : array
If an optional mask array is passed, this only returns the keys that match the mask
| access | public |
|---|---|
| inherited_from | \Klein\DataCollection\DataCollection::all() |
arrayThe parameter mask array
booleanWhether or not to fill the returned array with null values to match the given mask
arraycount() : int
Allows the use of the "count" function (or any internal counters) to simply count the number of attributes in the collection.
| see | \Countable::count() |
|---|---|
| access | public |
| inherited_from | \Klein\DataCollection\DataCollection::count() |
intexists(string $key) : boolean
| see | \Klein\DataCollection\DataCollection::exists() |
|---|---|
| access | public |
stringThe name of the header
booleanget(string $key, mixed $default_val) : mixed
Return a default value if the key doesn't exist
| see | \Klein\DataCollection\DataCollection::get() |
|---|---|
| access | public |
stringThe name of the header to return
mixedThe default value of the header if it contains no value
mixedgetIterator() : \ArrayIterator
IteratorAggregate interface required method
| see | \IteratorAggregate::getIterator() |
|---|---|
| access | public |
| inherited_from | \Klein\DataCollection\DataCollection::getIterator() |
merge(array $attributes, boolean $hard) : \Klein\DataCollection\DataCollection
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
| access | public |
|---|---|
| inherited_from | \Klein\DataCollection\DataCollection::merge() |
arrayThe attributes to merge into the collection
booleanWhether or not to make the merge "hard"
normalizeName(string $name, boolean $make_lowercase) : string
This is useful since PHP automatically capitalizes and underscore separates the words of headers
| link | http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2 |
|---|---|
| static | |
| access | public |
stringThe name ("field") of the header
booleanWhether or not to lowercase the name
stringoffsetExists(string $key) : boolean
Allows the access of attributes of this instance while treating it like an array
| see | \ArrayAccess::offsetExists() |
|---|---|
| see | \Klein\DataCollection\exists() |
| access | public |
| inherited_from | \Klein\DataCollection\DataCollection::offsetExists() |
stringThe name of the parameter
booleanoffsetGet(string $key) : mixed
Allows the access of attributes of this instance while treating it like an array
| see | \ArrayAccess::offsetGet() |
|---|---|
| see | \Klein\DataCollection\get() |
| access | public |
| inherited_from | \Klein\DataCollection\DataCollection::offsetGet() |
stringThe name of the parameter to return
mixedoffsetSet(string $key, mixed $value) : void
Allows the access of attributes of this instance while treating it like an array
| see | \ArrayAccess::offsetSet() |
|---|---|
| see | \Klein\DataCollection\set() |
| access | public |
| inherited_from | \Klein\DataCollection\DataCollection::offsetSet() |
stringThe name of the parameter to set
mixedThe value of the parameter to set
offsetUnset(string $key) : void
Allows the access of attributes of this instance while treating it like an array
| see | \ArrayAccess::offsetUnset() |
|---|---|
| see | \Klein\DataCollection\remove() |
| access | public |
| inherited_from | \Klein\DataCollection\DataCollection::offsetUnset() |
stringThe name of the parameter
remove(string $key) : void
| see | \Klein\DataCollection\DataCollection::remove() |
|---|---|
| access | public |
stringThe name of the header
replace(array $attributes) : \Klein\DataCollection\DataCollection
| access | public |
|---|---|
| inherited_from | \Klein\DataCollection\DataCollection::replace() |
arrayThe attributes to replace the collection's with
set(string $key, mixed $value) : \Klein\DataCollection\HeaderDataCollection
| see | \Klein\DataCollection\DataCollection::set() |
|---|---|
| access | public |
stringThe name of the header to set
mixedThe value of the header to set
$attributes : array
| access | protected |
|---|---|
| inherited_from | \Klein\DataCollection\DataCollection::$$attributes |