function testWriteToDatabase() { $obj = new GeoPolygonTest_Obj(); $obj->Polygon = GeoPolygon::from_rings(array($this->outerRingArr, $this->innerRingArr)); $obj->write(); // Test that the geo-data was saved properly $this->assertEquals($this->testWKTString, DB::query("SELECT AsText(Polygon) FROM GeoPolygonTest_Obj WHERE ID = {$obj->ID}")->value()); }
/** * @param array $rings see {@link setAsRings()} */ public static function from_rings($rings) { $obj = new GeoPolygon(null); $obj->setAsRings($rings); return $obj; }