[TYPO3-dev] Remove records from extbase query result

Philipp philippwrann at gmx.at
Tue Jan 14 08:39:58 CET 2014


You can make a direct sql query with a haversine in it and then use the mapper to do the mapping like it would be done in a regular repository method. I am looking forward to implement that mechanism myself, its a little work to do but not that hard i think. Additionally you could then use the calculated and selected distance and set it in a transient property of your object.

Then -of course- you should also write your own paginate viewhelper which can handle that direct sql and adds offset/limit itself.

A transient distance property natively supported by Flow/Extbase would be very nice

something like

/**
* @var float
* @transient
*/
protected $distance

#####

$query->matching($query->lowerThanOrEqual('distance',$query->calculate('haversine',$coords1,$coords2)))->setOrdering('distance',ASC)->execute();

$coords would be an interface having
getLatitude()
getLongitude()

#####

And calculate could easily be extended like Validation or something.... so you could feed your results transient properties from your query result.

Could be managed quiet easily and would add up much power to Flow/Extbase.



More information about the TYPO3-dev mailing list