public function __construct(Point $point)
 {
     $this->entity = $point;
     $this->entityDTO = new PointDTO();
     $this->entityDTO->latitude = $this->entity->getLatitude();
     $this->entityDTO->longitude = $this->entity->getLongitude();
 }
Example #2
0
 public function testGetGeoBox()
 {
     $point = new Point($this->latitude, $this->longitude);
     $points = $point->getGeoBox(50);
     $upperLeft = $points[0];
     $bottomRight = $points[1];
     $this->assertEquals(33.3285403, $upperLeft->getLatitude(), '', FLOAT_DELTA);
     $this->assertEquals(-118.9673787, $upperLeft->getLongitude(), '', FLOAT_DELTA);
     $this->assertEquals(34.7759277, $bottomRight->getLatitude(), '', FLOAT_DELTA);
     $this->assertEquals(-117.5199913, $bottomRight->getLongitude(), '', FLOAT_DELTA);
 }
Example #3
0
 public function withDistance(Point $point)
 {
     return $this->addSelect('DISTANCE(Warehouse.address.point.latitude,Warehouse.address.point.longitude,' . $point->getLatitude() . ',' . $point->getLongitude() . ') AS distance');
 }