[TYPO3-dev] Remove records from extbase query result
Dirk Wenzel
wenzel at webfox03.de
Sun Jan 12 22:45:32 CET 2014
Hi all,
is it possible to remove records from a query result?
I tried using
unset($result[$key]) and
$result->offsetUnset($key)
(where key is the current key in a foreach loop),
but neither works.
Background:
I do search for domain objects in a radius around a given location.
Therefore I compute a bounding box of geographic latitude and longitude
around this location. All objects which are located in this box are
returned.
For an actual *radius* I have to compute the distance between the
location and each object. This can not be done as a query constraint. So
I have to narrow down the result later.
Converting the result to an array is not an option since the result is
being displayed with pagination and the paginator expects a query result.
The code can be seen under
https://github.com/dwenzel/placements/blob/release/0.6/Classes/Controller/PositionController.php
beginning at line 153
Cheers
Dirk
More information about the TYPO3-dev
mailing list