CoolCMS API

HaversineFunction extends FunctionNode
in package

DQL function `HAVERSINE(advert_lat, advert_lon, :search_lat_cos, :search_lon, :search_lat_sin)`.

Returns the distance in km between the coordinates stored in the database (text columns, cast to decimal) and the searched coordinates (float parameters).

The searched latitude is passed as two parameters (args[2] and args[4]) with the same value but different names; otherwise DBAL v4 would create two positional ? for one named parameter.

Usage:

haversine(prel_lat.value, prel_lon.value, :searchLatCos, :searchLon, :searchLatSin) <= :radiusKm

Table of Contents

Properties

$args  : array<int, Node|string>

Methods

getSql()  : string
parse()  : void

Properties

$args

private array<int, Node|string> $args = []

parsed arguments; ArithmeticPrimary() returns a node, or a string for a literal

Methods

getSql()

public getSql(SqlWalker $sqlWalker) : string
Parameters
$sqlWalker : SqlWalker
Return values
string
On this page

Search results