[ Index ] |
PHP Cross Reference of phpBB-3.2.11-deutsch |
[Source view] [Print] [Project Stats]
(no description)
File Size: | 236 lines (6 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
Collection:: (15 methods):
__construct()
fromConfig()
clear()
get()
set()
add()
remove()
getKeys()
hasKey()
hasValue()
replace()
merge()
overwriteWith()
map()
filter()
Class: Collection - X-Ref
Key value pair collection object__construct(array $data = []) X-Ref |
param: array $data Associative array of data to set |
fromConfig(array $config = [],array $defaults = [],array $required = []) X-Ref |
Create a new collection from an array, validate the keys, and add default values where missing param: array $config Configuration values to apply. param: array $defaults Default parameters param: array $required Required parameter names return: self |
clear() X-Ref |
Removes all key value pairs |
get($key) X-Ref |
Get a specific key value. param: string $key Key to retrieve. return: mixed|null Value of the key or NULL |
set($key, $value) X-Ref |
Set a key value pair param: string $key Key to set param: mixed $value Value to set |
add($key, $value) X-Ref |
Add a value to a key. If a key of the same name has already been added, the key value will be converted into an array and the new value will be pushed to the end of the array. param: string $key Key to add param: mixed $value Value to add to the key |
remove($key) X-Ref |
Remove a specific key value pair param: string $key A key to remove |
getKeys() X-Ref |
Get all keys in the collection return: array |
hasKey($key) X-Ref |
Returns whether or not the specified key is present. param: string $key The key for which to check the existence. return: bool |
hasValue($value) X-Ref |
Checks if any keys contains a certain value param: string $value Value to search for return: mixed Returns the key if the value was found FALSE if the value |
replace(array $data) X-Ref |
Replace the data of the object with the value of an array param: array $data Associative array of data |
merge($data) X-Ref |
Add and merge in a Collection or array of key value pair data. param: Collection|array $data Associative array of key value pair data |
overwriteWith($data) X-Ref |
Overwrite key value pairs in this collection with all of the data from an array or collection. param: array|\Traversable $data Values to override over this config |
map(callable $closure, array $context = []) X-Ref |
Returns a Collection containing all the elements of the collection after applying the callback function to each one. The callable should accept three arguments: - (string) $key - (string) $value - (array) $context The callable must return a the altered or unaltered value. param: callable $closure Map function to apply param: array $context Context to pass to the callable return: Collection |
filter(callable $closure) X-Ref |
Iterates over each key value pair in the collection passing them to the callable. If the callable returns true, the current value from input is returned into the result Collection. The callable must accept two arguments: - (string) $key - (string) $value param: callable $closure Evaluation function return: Collection |
Generated: Wed Nov 11 20:33:01 2020 | Cross-referenced by PHPXref 0.7.1 |