jhartikainen/doctrine2-spatial — Issue #1: Point now must extend Doctrine\DBAL\Types\Type
Author: fuhrysteve
Created: 2012-02-19 15:32:42+00:00
State: open

This seems to be a bit out of date. I've pulled this and made some tweaks in my own library.. If I end up doing much more I might fork and do a pull request, but for now, here's how to get Point working at least:

```php
latitude = $x;
}

public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform) {
return sprintf('POINT(%f %f)', $this->latitude, $this->longitude);
}

public function getName() {
return 'point';
}

public function getLatitude() {
return $this->latitude;
}

public function setLongitude($y) {
$this->longitude = $y;
}

public function getLongitude() {
return $this->longitude;
}

public function __toString() {
//Output from this is used with POINT_STR in DQL so must be in specific format
return sprintf('POINT(%f %f)', $this->latitude, $this->longitude);
}
}
```