public function filterByDistance(\Tx_Oelib_List $unfilteredObjects, \Tx_Oelib_Interface_Geo $center, $distance)
    {
        $objectsWithinDistance = new \Tx_Oelib_List();

        /** @var \Tx_Oelib_Interface_Geo|\Tx_Oelib_Model $object */
        foreach ($unfilteredObjects as $object) {
            if ($this->calculateDistanceInKilometers($center, $object) <= $distance) {
                $objectsWithinDistance->add($object);
            }
        }

        return $objectsWithinDistance;
    }
public function filterByDistance(\Tx_Oelib_List $unfilteredObjects, \Tx_Oelib_Interface_Geo $center, $distance)
    {
        $objectsWithinDistance = new \Tx_Oelib_List();

        /** @var \Tx_Oelib_Interface_Geo|\Tx_Oelib_Model $object */
        foreach ($unfilteredObjects as $object) {
            if ($this->calculateDistanceInKilometers($center, $object) <= $distance) {
                $objectsWithinDistance->add($object);
            }
        }

        return $objectsWithinDistance;
    }
public function filterByDistance ( \ Tx_Oelib_List $ unfilteredObjects , \ Tx_Oelib_Interface_Geo $ center , $ distance ) { $ objectsWithinDistance = new \ Tx_Oelib_List ( ) ; /** @var \Tx_Oelib_Interface_Geo|\Tx_Oelib_Model $object */ foreach ( $ unfilteredObjects as $ object ) { if ( $ this -> calculateDistanceInKilometers ( $ center , $ object ) <= $ distance ) { $ objectsWithinDistance -> add ( $ object ) ; } } return $ objectsWithinDistance ; }
Filters a list of geo objects by distance around another geo object.

The returned list will only contain objects that are within $distance of
$center, including objects that are located at a distance of exactly
$distance.

@param \Tx_Oelib_List<\Tx_Oelib_Interface_Geo> $unfilteredObjects
the list to filter, may be empty
@param \Tx_Oelib_Interface_Geo $center
the center to which $distance related
@param float $distance
the distance in kilometers within which the returned objects must
be located

@return \Tx_Oelib_List<\Tx_Oelib_Interface_Geo>
a copy of $unfilteredObjects with only those objects that are
located within $distance kilometers of $center
Filters a list of geo objects by distance around another geo object .