PHP Class eZ\Publish\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler\MapLocationDistance

Inheritance: extends FieldBase
Show file Open project: ezsystems/ezpublish-kernel

Public Methods

Method Description
accept ( eZ\Publish\API\Repository\Values\Content\Query\Criterion $criterion ) : boolean Check if this criterion handler accepts to handle the given criterion.
handle ( CriteriaConverter $converter, eZ\Publish\Core\Persistence\Database\SelectQuery $query, eZ\Publish\API\Repository\Values\Content\Query\Criterion $criterion, array $languageSettings ) : eZ\Publish\Core\Persistence\Database\Expression Generate query expression for a Criterion this handler accepts.

Protected Methods

Method Description
getBoundingConstraints ( eZ\Publish\Core\Persistence\Database\SelectQuery $query, eZ\Publish\API\Repository\Values\Content\Query\Criterion\Value\MapLocationValue $location, float $distance ) : array Credit for the formula goes to http://janmatuschek.de/LatitudeLongitudeBoundingCoordinates.
getBoundingCoordinates ( eZ\Publish\API\Repository\Values\Content\Query\Criterion\Value\MapLocationValue $location, float $distance ) : array Calculates and returns bounding box coordinates.
getFieldDefinitionIds ( string $fieldIdentifier ) : array Returns a list of IDs of searchable FieldDefinitions for the given criterion target.
kilometersToDegrees ( $kilometers )

Method Details

accept() public method

Check if this criterion handler accepts to handle the given criterion.
public accept ( eZ\Publish\API\Repository\Values\Content\Query\Criterion $criterion ) : boolean
$criterion eZ\Publish\API\Repository\Values\Content\Query\Criterion
return boolean

getBoundingConstraints() protected method

Credit for the formula goes to http://janmatuschek.de/LatitudeLongitudeBoundingCoordinates.
protected getBoundingConstraints ( eZ\Publish\Core\Persistence\Database\SelectQuery $query, eZ\Publish\API\Repository\Values\Content\Query\Criterion\Value\MapLocationValue $location, float $distance ) : array
$query eZ\Publish\Core\Persistence\Database\SelectQuery
$location eZ\Publish\API\Repository\Values\Content\Query\Criterion\Value\MapLocationValue
$distance float
return array

getBoundingCoordinates() protected method

Credits: http://janmatuschek.de/LatitudeLongitudeBoundingCoordinates
protected getBoundingCoordinates ( eZ\Publish\API\Repository\Values\Content\Query\Criterion\Value\MapLocationValue $location, float $distance ) : array
$location eZ\Publish\API\Repository\Values\Content\Query\Criterion\Value\MapLocationValue
$distance float
return array

getFieldDefinitionIds() protected method

Returns a list of IDs of searchable FieldDefinitions for the given criterion target.
protected getFieldDefinitionIds ( string $fieldIdentifier ) : array
$fieldIdentifier string
return array

handle() public method

accept() must be called before calling this method.
public handle ( CriteriaConverter $converter, eZ\Publish\Core\Persistence\Database\SelectQuery $query, eZ\Publish\API\Repository\Values\Content\Query\Criterion $criterion, array $languageSettings ) : eZ\Publish\Core\Persistence\Database\Expression
$converter eZ\Publish\Core\Search\Legacy\Content\Common\Gateway\CriteriaConverter
$query eZ\Publish\Core\Persistence\Database\SelectQuery
$criterion eZ\Publish\API\Repository\Values\Content\Query\Criterion
$languageSettings array
return eZ\Publish\Core\Persistence\Database\Expression

kilometersToDegrees() protected method

protected kilometersToDegrees ( $kilometers )