PHP Интерфейс Collections\DictionaryInterface

Наследование: extends IteratorAggregate, extends Countable
Показать файл Открыть проект

Открытые методы

Метод Описание
add ( $key, $value ) : static Adds the key-value pair containing $key and $value to the dictionary.
clear ( ) : static Removes every key-value pair from the dictionary.
count ( ) : integer Returns the number of key-value pairs in the dictionary.
delete ( $key ) : static Removes the key-value pair represented by $key from the dictionary.
each ( callable $callable ) Applies the callback function $callable to each key-value pair in the dictionary.
exists ( $key ) : boolean Returns true if $key is in the dictionary, returns false if it is not.
filter ( callable $condition ) : static Returns a dictionary that only contains the key-value pairs which satisfy $condition.
get ( $key ) : mixed Returns the value associated with $key.
getKeyType ( ) : string Returns the type of the dictionary's keys.
getOrElse ( $key, $default ) : mixed Returns the value associated with $key in the dictionary, returns $default if it does not.
getValueType ( ) : string Returns the type of the dictionary's values.
keys ( ) : array Returns an array of all keys in the dictionary.
map ( callable $callable ) : static Returns a new dictionary with the callback function $callable applied to every key-value pair in the dictionary.
merge ( $newItems ) : static Adds every key-value pair in $newItems to the dictionary.
toArray ( ) : array Returns the key-value pairs in the dictionary as an associative array.
valueExists ( $value ) : boolean Returns true if $value is in the dictionary, returns false if not.
values ( ) : array Returns an array of all values in the dictionary.
without ( callable $condition ) : static Removes all key-value pairs from the Dictionary that do not satisfy $condition.

Описание методов

add() публичный Метод

Adds the key-value pair containing $key and $value to the dictionary.
public add ( $key, $value ) : static
$key
$value
Результат static

clear() публичный Метод

Removes every key-value pair from the dictionary.
public clear ( ) : static
Результат static

count() публичный Метод

Returns the number of key-value pairs in the dictionary.
public count ( ) : integer
Результат integer

delete() публичный Метод

Removes the key-value pair represented by $key from the dictionary.
public delete ( $key ) : static
$key
Результат static

each() публичный Метод

Applies the callback function $callable to each key-value pair in the dictionary.
public each ( callable $callable )
$callable callable

exists() публичный Метод

Returns true if $key is in the dictionary, returns false if it is not.
public exists ( $key ) : boolean
$key
Результат boolean

filter() публичный Метод

Returns a dictionary that only contains the key-value pairs which satisfy $condition.
public filter ( callable $condition ) : static
$condition callable
Результат static

get() публичный Метод

Returns the value associated with $key.
public get ( $key ) : mixed
$key
Результат mixed

getKeyType() публичный Метод

Returns the type of the dictionary's keys.
public getKeyType ( ) : string
Результат string

getOrElse() публичный Метод

Returns the value associated with $key in the dictionary, returns $default if it does not.
public getOrElse ( $key, $default ) : mixed
$key
$default
Результат mixed

getValueType() публичный Метод

Returns the type of the dictionary's values.
public getValueType ( ) : string
Результат string

keys() публичный Метод

Returns an array of all keys in the dictionary.
public keys ( ) : array
Результат array

map() публичный Метод

Returns a new dictionary with the callback function $callable applied to every key-value pair in the dictionary.
public map ( callable $callable ) : static
$callable callable
Результат static

merge() публичный Метод

Adds every key-value pair in $newItems to the dictionary.
public merge ( $newItems ) : static
$newItems
Результат static

toArray() публичный Метод

Returns the key-value pairs in the dictionary as an associative array.
public toArray ( ) : array
Результат array

valueExists() публичный Метод

Returns true if $value is in the dictionary, returns false if not.
public valueExists ( $value ) : boolean
$value
Результат boolean

values() публичный Метод

Returns an array of all values in the dictionary.
public values ( ) : array
Результат array

without() публичный Метод

Removes all key-value pairs from the Dictionary that do not satisfy $condition.
public without ( callable $condition ) : static
$condition callable
Результат static