ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
|
Public Member Functions | |
__construct (array $items=[]) | |
Create new collection. More... | |
set ($key, $value) | |
Set collection item. More... | |
get ($key, $default=null) | |
Get collection item for key. More... | |
replace (array $items) | |
Add item to collection, replacing existing items with the same data key. More... | |
all () | |
Get all items in collection. More... | |
keys () | |
Get collection keys. More... | |
has ($key) | |
Does this collection have a given key? More... | |
remove ($key) | |
Remove item from collection. More... | |
clear () | |
Remove all items from collection. More... | |
offsetExists ($key) | |
Does this collection have a given key? More... | |
offsetGet ($key) | |
Get collection item for key. More... | |
offsetSet ($key, $value) | |
Set collection item. More... | |
offsetUnset ($key) | |
Remove item from collection. More... | |
count () | |
Get number of items in collection. More... | |
getIterator () | |
Get collection iterator. More... | |
Protected Attributes | |
$data = [] | |
This class provides a common interface used by many other classes in a Slim application that manage "collections" of data that must be inspected and/or manipulated
Definition at line 21 of file Collection.php.
Slim\Collection::__construct | ( | array | $items = [] | ) |
Create new collection.
array | $items | Pre-populate collection with this key-value array |
Definition at line 35 of file Collection.php.
Slim\Collection::all | ( | ) |
Get all items in collection.
Implements Slim\Interfaces\CollectionInterface.
Definition at line 85 of file Collection.php.
References $data.
Referenced by Slim\Http\Request\createFromEnvironment().
Slim\Collection::clear | ( | ) |
Remove all items from collection.
Implements Slim\Interfaces\CollectionInterface.
Definition at line 125 of file Collection.php.
References data.
Slim\Collection::count | ( | ) |
Get number of items in collection.
Definition at line 184 of file Collection.php.
References data.
Slim\Collection::get | ( | $key, | |
$default = null |
|||
) |
Get collection item for key.
string | $key | The data key |
mixed | $default | The default value to return if data key does not exist |
Implements Slim\Interfaces\CollectionInterface.
Definition at line 63 of file Collection.php.
Referenced by Slim\Http\Uri\createFromEnvironment(), and Slim\Http\Headers\determineAuthorization().
Slim\Collection::getIterator | ( | ) |
Slim\Collection::has | ( | $key | ) |
Does this collection have a given key?
string | $key | The data key |
Implements Slim\Interfaces\CollectionInterface.
Definition at line 107 of file Collection.php.
Referenced by Slim\Http\UploadedFile\createFromEnvironment(), and Slim\Http\Uri\createFromEnvironment().
Slim\Collection::keys | ( | ) |
Get collection keys.
Definition at line 95 of file Collection.php.
References data.
Slim\Collection::offsetExists | ( | $key | ) |
Does this collection have a given key?
string | $key | The data key |
Definition at line 141 of file Collection.php.
References $key.
Slim\Collection::offsetGet | ( | $key | ) |
Get collection item for key.
string | $key | The data key |
Definition at line 153 of file Collection.php.
References $key.
Slim\Collection::offsetSet | ( | $key, | |
$value | |||
) |
Set collection item.
string | $key | The data key |
mixed | $value | The data value |
Definition at line 164 of file Collection.php.
References $key.
Slim\Collection::offsetUnset | ( | $key | ) |
Remove item from collection.
string | $key | The data key |
Definition at line 174 of file Collection.php.
References $key.
Slim\Collection::remove | ( | $key | ) |
Remove item from collection.
string | $key | The data key |
Implements Slim\Interfaces\CollectionInterface.
Definition at line 117 of file Collection.php.
Slim\Collection::replace | ( | array | $items | ) |
Add item to collection, replacing existing items with the same data key.
array | $items | Key-value array of data to append to this collection |
Implements Slim\Interfaces\CollectionInterface.
Definition at line 73 of file Collection.php.
References $key.
Slim\Collection::set | ( | $key, | |
$value | |||
) |
Set collection item.
string | $key | The data key |
mixed | $value | The data value |
Implements Slim\Interfaces\CollectionInterface.
Definition at line 50 of file Collection.php.
Referenced by Slim\Http\Headers\determineAuthorization().
|
protected |
Definition at line 28 of file Collection.php.
Referenced by Slim\Http\Headers\createFromEnvironment(), and Slim\Http\Environment\mock().