PHP Class Neos\Neos\Fusion\Helper\ArrayHelper

These helpers are *WORK IN PROGRESS* and *NOT STABLE YET*
Inheritance: implements Neos\Eel\ProtectedContextAwareInterface
Show file Open project: neos/neos

Public Methods

Method Description
allowsCallOfMethod ( string $methodName ) : boolean All methods are considered safe
filter ( array | Doctrine\Common\Collections\Collection $set, string $filterProperty ) : array Filter an array of objects, by only keeping the elements where each object's $filterProperty evaluates to TRUE.
filterNegated ( array | Doctrine\Common\Collections\Collection $set, string $filterProperty ) : array Filter an array of objects, by only keeping the elements where each object's $filterProperty evaluates to FALSE.
groupBy ( array | Doctrine\Common\Collections\Collection $set, string $groupingKey ) : array The input is assumed to be an array or Collection of objects. Groups this input by the $groupingKey property of each element.

Protected Methods

Method Description
filterInternal ( array | Doctrine\Common\Collections\Collection $set, string $filterProperty, boolean $negate ) : array Internal method for filtering

Method Details

allowsCallOfMethod() public method

All methods are considered safe
public allowsCallOfMethod ( string $methodName ) : boolean
$methodName string
return boolean

filter() public method

Filter an array of objects, by only keeping the elements where each object's $filterProperty evaluates to TRUE.
public filter ( array | Doctrine\Common\Collections\Collection $set, string $filterProperty ) : array
$set array | Doctrine\Common\Collections\Collection
$filterProperty string
return array

filterInternal() protected method

Internal method for filtering
protected filterInternal ( array | Doctrine\Common\Collections\Collection $set, string $filterProperty, boolean $negate ) : array
$set array | Doctrine\Common\Collections\Collection
$filterProperty string
$negate boolean
return array

filterNegated() public method

Filter an array of objects, by only keeping the elements where each object's $filterProperty evaluates to FALSE.
public filterNegated ( array | Doctrine\Common\Collections\Collection $set, string $filterProperty ) : array
$set array | Doctrine\Common\Collections\Collection
$filterProperty string
return array

groupBy() public method

The input is assumed to be an array or Collection of objects. Groups this input by the $groupingKey property of each element.
public groupBy ( array | Doctrine\Common\Collections\Collection $set, string $groupingKey ) : array
$set array | Doctrine\Common\Collections\Collection
$groupingKey string
return array