PHP Интерфейс Pinq\Iterators\IOrderedMap

Автор: Elliot Levin ([email protected])
Наследование: extends Traversable, extends ArrayAccess, extends Countable
Показать файл Открыть проект Примеры использования интерфейса

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

Метод Описание
clear ( ) : void Removes all keys and values from the map.
contains ( mixed $key ) : boolean Returns whether their is value associated with the supplied key.
get ( mixed $key ) : mixed Returns the value associated with the supplied key or null if it does not exist.
groupBy ( callable $groupKeyFunction ) : Pinq\Iterators\IOrderedMap Groups the keys / values using the supplied function into new ordered map.
keys ( ) : array Returns all the keys from the map as an array.
map ( callable $function ) : Pinq\Iterators\IOrderedMap Maps the keys / values of the dictionary to new dictionary.
multisort ( array $orderFunctions, array $isAscending ) : Pinq\Iterators\IOrderedMap Creates a new ordered map with the keys and values sorted according the the supplied functions and order directions.
offsetGet ( mixed $key ) : mixed Returns the value associated with the supplied key or null if it does not exist.
remove ( mixed $key ) : boolean Removes the element (if exists) with the supplied key.
set ( mixed $key, mixed $value ) : void Sets the supplied key to the supplied value.
setAll ( Traversable $elements ) : void Sets the supplied keys and values from the elements iterator.
setRef ( mixed $key, mixed &$value ) : void Sets the supplied key to the supplied value by reference.
values ( ) : array Returns all the values from the map as an array.
walk ( callable $function ) : void Walks the elements with the supplied function

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

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

Removes all keys and values from the map.
public clear ( ) : void
Результат void

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

Returns whether their is value associated with the supplied key.
public contains ( mixed $key ) : boolean
$key mixed
Результат boolean

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

Returns the value associated with the supplied key or null if it does not exist.
public get ( mixed $key ) : mixed
$key mixed
Результат mixed

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

Groups the keys / values using the supplied function into new ordered map.
public groupBy ( callable $groupKeyFunction ) : Pinq\Iterators\IOrderedMap
$groupKeyFunction callable
Результат Pinq\Iterators\IOrderedMap

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

Indexed by their 0-based position.
public keys ( ) : array
Результат array

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

Maps the keys / values of the dictionary to new dictionary.
public map ( callable $function ) : Pinq\Iterators\IOrderedMap
$function callable The elements are passed as ($value, $key)
Результат Pinq\Iterators\IOrderedMap

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

Creates a new ordered map with the keys and values sorted according the the supplied functions and order directions.
public multisort ( array $orderFunctions, array $isAscending ) : Pinq\Iterators\IOrderedMap
$orderFunctions array
$isAscending array
Результат Pinq\Iterators\IOrderedMap

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

Returns the value associated with the supplied key or null if it does not exist.
public offsetGet ( mixed $key ) : mixed
$key mixed
Результат mixed

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

Removes the element (if exists) with the supplied key.
public remove ( mixed $key ) : boolean
$key mixed
Результат boolean Whether the key was succefully remove or false if does not exist

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

Sets the supplied key to the supplied value.
public set ( mixed $key, mixed $value ) : void
$key mixed
$value mixed
Результат void

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

Sets the supplied keys and values from the elements iterator.
public setAll ( Traversable $elements ) : void
$elements Traversable
Результат void

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

Sets the supplied key to the supplied value by reference.
public setRef ( mixed $key, mixed &$value ) : void
$key mixed
$value mixed
Результат void

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

Indexed by their 0-based position.
public values ( ) : array
Результат array

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

Walks the elements with the supplied function
public walk ( callable $function ) : void
$function callable
Результат void