protected function loadFieldData($fieldId, $versionNo)
{
$connection = $this->getConnection();
$selectQuery = $connection->createSelectQuery();
$selectQuery->select($connection->quoteColumn('latitude'), $connection->quoteColumn('longitude'), $connection->quoteColumn('address'))->from($connection->quoteTable('ezgmaplocation'))->where($selectQuery->expr->lAnd($selectQuery->expr->eq($connection->quoteColumn('contentobject_attribute_id'), $selectQuery->bindValue($fieldId, null, \PDO::PARAM_INT)), $selectQuery->expr->eq($connection->quoteColumn('contentobject_version'), $selectQuery->bindValue($versionNo, null, \PDO::PARAM_INT))));
$statement = $selectQuery->prepare();
$statement->execute();
$rows = $statement->fetchAll(\PDO::FETCH_ASSOC);
if (!isset($rows[0])) {
return null;
}
// Cast coordinates as the DB can return them as strings
$rows[0]['latitude'] = (double) $rows[0]['latitude'];
$rows[0]['longitude'] = (double) $rows[0]['longitude'];
return $rows[0];
}