NamedParameterMap
class NamedParameterMap extends AbstractMap (View source)
NamedParameterMap represents a mapping of values to a set of named keys that may optionally be typed
Traits
Properties
| protected array | $data | from AbstractArray | |
| protected array | $namedParameters |
Methods
Constructs a new NamedParameterMap object
Checks whether the specified offset exists in the array
Returns the value stored at the specified offset in the array
Sets the specified offset in the map with the given value
Removes the specified offset and its value from the map
Converts this map object to a string when the object is serialized
with serialize()
Re-constructs the object from its serialized form
Returns a native PHP array containing all of the elements in this array object
Returns true if this map contains a mapping for the specified key
Returns true if this map maps one or more keys to the specified value
Returns the value to which the specified key is mapped, null if this
map contains no mapping for the key, or (optionally) $defaultValue if
this map contains no mapping for the key
Associates the specified value with the specified key in this map
If the specified key is not already associated with a value (or is mapped to null) associates it with the given value and returns null, else returns the current value
Removes the mapping for a key from this map if it is present
Removes the entry for the specified key only if it is currently mapped to the specified value
Replaces the entry for the specified key only if it is currently mapped to some value
Replaces the entry for the specified key only if currently mapped to the specified value
Returns true if value is of the specified type
Return a string with the information of the value null value: NULL boolean: TRUE, FALSE array: Array scalar: converted-value resource: (type resource #number) object with __toString(): result of __toString() object DateTime: ISO 8601 date object: (className Object) anonymous function: same as object
Returns named parameters set for this NamedParameterMap
Given an array of named parameters, constructs a proper mapping of named parameters to types
Details
at line 40
__construct(array $namedParameters, array $data = [])
Constructs a new NamedParameterMap object
in AbstractArray at line 48
ArrayIterator
getIterator()
Returns a new iterator from this array
in AbstractArray at line 60
bool
offsetExists(mixed $offset)
Checks whether the specified offset exists in the array
in AbstractArray at line 72
mixed
offsetGet(mixed $offset)
Returns the value stored at the specified offset in the array
at line 56
offsetSet(mixed $offset, mixed $value)
Sets the specified offset in the map with the given value
in AbstractArray at line 100
offsetUnset(mixed $offset)
Removes the specified offset and its value from the map
in AbstractArray at line 112
string
serialize()
Converts this map object to a string when the object is serialized
with serialize()
in AbstractArray at line 123
unserialize(string $serialized)
Re-constructs the object from its serialized form
in AbstractArray at line 134
int
count()
Returns the number of elements contained in this array
in AbstractArray at line 139
void
clear()
Remove all the elements from this array object
in AbstractArray at line 144
toArray()
Returns a native PHP array containing all of the elements in this array object
in AbstractArray at line 149
bool
isEmpty()
Returns true if this array object contains no elements
in AbstractMap at line 37
bool
containsKey(mixed $key)
Returns true if this map contains a mapping for the specified key
in AbstractMap at line 42
bool
containsValue(mixed $value)
Returns true if this map maps one or more keys to the specified value
This performs a strict type check on the value.
in AbstractMap at line 47
array
keys()
Return an array of the keys contained in this map
in AbstractMap at line 52
mixed|null
get(mixed $key, mixed $defaultValue = null)
Returns the value to which the specified key is mapped, null if this
map contains no mapping for the key, or (optionally) $defaultValue if
this map contains no mapping for the key
in AbstractMap at line 61
mixed
put(mixed $key, mixed $value)
Associates the specified value with the specified key in this map
If the map previously contained a mapping for the key, the old value is replaced by the specified value.
in AbstractMap at line 69
mixed
putIfAbsent(mixed $key, mixed $value)
If the specified key is not already associated with a value (or is mapped to null) associates it with the given value and returns null, else returns the current value
in AbstractMap at line 80
mixed
remove(mixed $key)
Removes the mapping for a key from this map if it is present
in AbstractMap at line 88
bool
removeIf(mixed $key, mixed $value)
Removes the entry for the specified key only if it is currently mapped to the specified value
This performs a strict type check on the value.
in AbstractMap at line 99
mixed
replace(mixed $key, mixed $value)
Replaces the entry for the specified key only if it is currently mapped to some value
in AbstractMap at line 110
bool
replaceIf(mixed $key, mixed $oldValue, mixed $newValue)
Replaces the entry for the specified key only if currently mapped to the specified value
This performs a strict type check on the value.
protected bool
checkType(string $type, mixed $value)
Returns true if value is of the specified type
in ValueToStringTrait at line 37
protected string
toolValueToString(mixed $value)
Return a string with the information of the value null value: NULL boolean: TRUE, FALSE array: Array scalar: converted-value resource: (type resource #number) object with __toString(): result of __toString() object DateTime: ISO 8601 date object: (className Object) anonymous function: same as object
at line 51
array
getNamedParameters()
Returns named parameters set for this NamedParameterMap
at line 83
protected array
filterNamedParameters(array $namedParameters)
Given an array of named parameters, constructs a proper mapping of named parameters to types