Skip to content

Latest commit

 

History

History
276 lines (178 loc) · 14.4 KB

mutateable.md

File metadata and controls

276 lines (178 loc) · 14.4 KB

Table of contents


Class: \Somnambulist\Components\Collection\Behaviours\Mutate\AppendOnlyUniqueValues

Trait AppendOnlyUniqueValues

Visibility Function
public add(\mixed $value) : \Somnambulist\Components\Collection\Collection/static
Append the value to the collection
public append(mixed $value) : \Somnambulist\Components\Collection\Collection/static
Add elements to the end of the collection
public concat(\iterable $items) : \Somnambulist\Components\Collection\Collection/static
Push all of the given items onto the collection.
public push(mixed $value) : \Somnambulist\Components\Collection\Collection/static
Alias of append

Class: \Somnambulist\Components\Collection\Behaviours\Mutate\RemoveValue

Trait RemoveValue

Visibility Function
public remove(\mixed $value) : \Somnambulist\Components\Collection\Collection/static
Remove the value from the collection

Class: \Somnambulist\Components\Collection\Behaviours\Mutate\Clear

Trait Clear

Visibility Function
public clear() : \Somnambulist\Components\Collection\Collection/static
Clear all elements from the collection
public reset() : \Somnambulist\Components\Collection\Collection/static
Alias of clear

Class: \Somnambulist\Components\Collection\Behaviours\Mutate\ShuffleNewCollection

Trait ShuffleNewCollection

Visibility Function
public shuffle() : \Somnambulist\Components\Collection\Collection/static
Shuffle the items in the collection; returning a new collection.

Class: \Somnambulist\Components\Collection\Behaviours\Mutate\MergeValues

Trait MergeValues

Visibility Function
public merge(\mixed $value) : \Somnambulist\Components\Collection\Collection/static
Merges the supplied array into the current Collection Note: should only be used with Collections of the same data, may cause strange results otherwise. This method will re-index keys and overwrite existing values. If you wish to preserve keys and values see {@link append}.

Class: \Somnambulist\Components\Collection\Behaviours\Mutate\CombineOnlyUniqueValues

Trait CombineOnlyUniqueValues

Visibility Function
public combine(\mixed $items) : \Somnambulist\Components\Collection\Collection/static
Create a collection by using this collection for keys and another for its values

Class: \Somnambulist\Components\Collection\Behaviours\Mutate\Shift

Trait Shift

Visibility Function
public shift() : mixed
Remove the first value from the collection

Class: \Somnambulist\Components\Collection\Behaviours\Mutate\Pad

Trait Pad

Visibility Function
public pad(integer/\int $size, \mixed $value) : \Somnambulist\Components\Collection\Collection/static
Pads the Collection to size using value as the value of the new elements

Class: \Somnambulist\Components\Collection\Behaviours\Mutate\AppendValues

Trait AppendValues

Visibility Function
public add(\mixed $value) : \Somnambulist\Components\Collection\Collection/static
Append the value to the collection
public append(mixed $value) : \Somnambulist\Components\Collection\Collection/static
Add elements to the end of the collection
public concat(\iterable $items) : \Somnambulist\Components\Collection\Collection/static
Push all of the given items onto the collection.
public push(mixed $value) : \Somnambulist\Components\Collection\Collection/static
Alias of append

Class: \Somnambulist\Components\Collection\Behaviours\Mutate\ReplaceValues

Trait ReplaceValues

Visibility Function
public replace(mixed $items) : \Somnambulist\Components\Collection\Collection/static
public replaceRecursively(mixed $items) : \Somnambulist\Components\Collection\Collection/static

Class: \Somnambulist\Components\Collection\Behaviours\Mutate\Fill

Trait Fill

Visibility Function
public fill(\int $start, \int $count, \mixed $value) : \Somnambulist\Components\Collection\Collection/static
Fill an array with values beginning at index defined by start for count members Start can be a negative number. Count can be zero or more.
public fillKeysWith(\mixed $value) : \Somnambulist\Components\Collection\Collection/static
For all values in the current Collection, use as a key and assign $value to them This should only be used with scalar values that can be used as array keys. A new Collection is returned with all previous values as keys, assigned the value.

Class: \Somnambulist\Components\Collection\Behaviours\Mutate\Shuffle

Trait Shuffle

Visibility Function
public shuffle() : \Somnambulist\Components\Collection\Collection/static
Shuffle the items in the collection; does NOT return a new collection.

Class: \Somnambulist\Components\Collection\Behaviours\Mutate\Flip

Trait Flip

Visibility Function
public flip() : \Somnambulist\Components\Collection\Collection/static
Exchange all values for keys and return new Collection Note: this should only be used with elements that can be used as valid PHP array keys.

Class: \Somnambulist\Components\Collection\Behaviours\Mutate\SetKeyValue

Trait SetKeyValue

Visibility Function
public set(int/string/\int $key, \mixed $value) : \Somnambulist\Components\Collection\Collection/static
Add the value at the specified key/offset to the collection

Class: \Somnambulist\Components\Collection\Behaviours\Mutate\Reverse

Trait Reverse

Visibility Function
public reverse() : \Somnambulist\Components\Collection\Collection/static
Reverses the data in the Collection maintaining any keys

Class: \Somnambulist\Components\Collection\Behaviours\Mutate\Pop

Trait Pop

Visibility Function
public pop() : mixed
Pops the element off the end of the Collection

Class: \Somnambulist\Components\Collection\Behaviours\Mutate\RemapKeys

Trait RemapKeys

Visibility Function
public remapKeys(array $map) : \Somnambulist\Components\Collection\Collection/static
From the provided map of key -> new_key; change the current key to new_key The previous key is unset from the collection.

Class: \Somnambulist\Components\Collection\Behaviours\Mutate\MergeOnlyUniqueValues

Trait MergeOnlyUniqueValues

Visibility Function
public merge(\mixed $value) : \Somnambulist\Components\Collection\Collection/static
Merges the supplied array into the current Collection Note: should only be used with Collections of the same data, may cause strange results otherwise. This method will re-index keys and overwrite existing values. If you wish to preserve keys and values see {@link append}.

Class: \Somnambulist\Components\Collection\Behaviours\Mutate\UnionValues

Trait UnionValues

Visibility Function
public union(\mixed $items) : \Somnambulist\Components\Collection\Collection/static
Union the collection with the given items.

Class: \Somnambulist\Components\Collection\Behaviours\Mutate\CombineValues

Trait CombineValues

Visibility Function
public combine(\mixed $items) : \Somnambulist\Components\Collection\Collection/static
Create a collection by using this collection for keys and another for its values

Class: \Somnambulist\Components\Collection\Behaviours\Mutate\PrependOnlyUniqueValues

Trait PrependOnlyUniqueValues

Visibility Function
public prepend(mixed $value) : \Somnambulist\Components\Collection\Collection/static
Prepends the elements to the beginning of the collection

Class: \Somnambulist\Components\Collection\Behaviours\Mutate\PrependValues

Trait PrependValues

Visibility Function
public prepend(mixed $value) : \Somnambulist\Components\Collection\Collection/static
Prepends the elements to the beginning of the collection

Class: \Somnambulist\Components\Collection\Behaviours\Mutate\UnsetKey

Trait UnsetKey

Visibility Function
public unset(int/string/\int $key) : \Somnambulist\Components\Collection\Collection/static
Remove the key from the collection

Class: \Somnambulist\Components\Collection\Behaviours\Mutate\UnionOnlyUniqueValues

Trait UnionOnlyUniqueValues

Visibility Function
public union(\mixed $items) : \Somnambulist\Components\Collection\Collection/static
Union the collection with the given items.