Spot\Entity\Collection::map PHP Method

map() public method

Runs a function on every object in the query, returning the resulting array
public map ( $func ) : mixed
return mixed An array containing the result of running the passed function on each member of the collect
    public function map($func)
    {
        $ret = array();
        foreach ($this as $obj) {
            $ret[] = $func($obj);
        }
        return $ret;
    }