Scalr\Model\Collections\EntityIterator::map PHP Méthode

map() public méthode

Implementation of array_map for EntityIterator Applies the callback to the elements of the Iterator
public map ( callable $callback ) : array
$callback callable Callback function to run for each element in each array
Résultat array An array containing all the elements after applying the callback function to each one
    public function map(callable $callback)
    {
        $ret = [];
        foreach ($this as $entity) {
            $ret[] = call_user_func($callback, $entity);
        }
        return $ret;
    }