PHP Interface Pinq\Iterators\IOrderedMap

Author: Elliot Levin ([email protected])
Inheritance: extends Traversable, extends ArrayAccess, extends Countable
Afficher le fichier Open project: timetoogo/pinq Interface Usage Examples

Méthodes publiques

Méthode Description
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

Method Details

clear() public méthode

Removes all keys and values from the map.
public clear ( ) : void
Résultat void

contains() public méthode

Returns whether their is value associated with the supplied key.
public contains ( mixed $key ) : boolean
$key mixed
Résultat boolean

get() public méthode

Returns the value associated with the supplied key or null if it does not exist.
public get ( mixed $key ) : mixed
$key mixed
Résultat mixed

groupBy() public méthode

Groups the keys / values using the supplied function into new ordered map.
public groupBy ( callable $groupKeyFunction ) : Pinq\Iterators\IOrderedMap
$groupKeyFunction callable
Résultat Pinq\Iterators\IOrderedMap

keys() public méthode

Indexed by their 0-based position.
public keys ( ) : array
Résultat array

map() public méthode

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)
Résultat Pinq\Iterators\IOrderedMap

multisort() public méthode

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
Résultat Pinq\Iterators\IOrderedMap

offsetGet() public méthode

Returns the value associated with the supplied key or null if it does not exist.
public offsetGet ( mixed $key ) : mixed
$key mixed
Résultat mixed

remove() public méthode

Removes the element (if exists) with the supplied key.
public remove ( mixed $key ) : boolean
$key mixed
Résultat boolean Whether the key was succefully remove or false if does not exist

set() public méthode

Sets the supplied key to the supplied value.
public set ( mixed $key, mixed $value ) : void
$key mixed
$value mixed
Résultat void

setAll() public méthode

Sets the supplied keys and values from the elements iterator.
public setAll ( Traversable $elements ) : void
$elements Traversable
Résultat void

setRef() public méthode

Sets the supplied key to the supplied value by reference.
public setRef ( mixed $key, mixed &$value ) : void
$key mixed
$value mixed
Résultat void

values() public méthode

Indexed by their 0-based position.
public values ( ) : array
Résultat array

walk() public méthode

Walks the elements with the supplied function
public walk ( callable $function ) : void
$function callable
Résultat void