Scalr\Model\Collections\EntityIterator::map PHP Method

map() public method

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
return 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;
    }