ArrayHelper
class ArrayHelper implements ProtectedContextAwareInterface (View source)
Some Functional Programming Array helpers for Eel contexts
These helpers are WORK IN PROGRESS and NOT STABLE YET
Methods
Filter an array of objects, by only keeping the elements where each object's $filterProperty evaluates to true.
Filter an array of objects, by only keeping the elements where each object's $filterProperty evaluates to false.
Internal method for filtering
The input is assumed to be an array or Collection of objects. Groups this input by the $groupingKey property of each element.
All methods are considered safe
Details
array
filter(array|Collection $set, string $filterProperty)
Filter an array of objects, by only keeping the elements where each object's $filterProperty evaluates to true.
array
filterNegated(array|Collection $set, string $filterProperty)
Filter an array of objects, by only keeping the elements where each object's $filterProperty evaluates to false.
protected array
filterInternal(array|Collection $set, string $filterProperty, bool $negate)
Internal method for filtering
array
groupBy(array|Collection $set, string $groupingKey)
The input is assumed to be an array or Collection of objects. Groups this input by the $groupingKey property of each element.
bool
allowsCallOfMethod(string $methodName)
All methods are considered safe