Hello, I am new to Phalcon...
How can I implement inside a model PostGIS functions?
More exacly I need to call ST_AsGeoJson(geom) when I select the model and on save ST_GeomFromText(geom).
Something like this:
class NYCBuildings extends \Phalcon\Mvc\Model
{
/**
* Geometry column
* @var string
* @Column(type="string", nullable=true)
*/
public $geom;
public function getGeom(){
return "ST_AsGeoJson(geom)";
}
public function setGeom($geom)
{
$this->geom = "ST_GeomFromText(".$geom.")";
}
}
How can I implement this corectly in Phalcon?
I have 7 models that have the geometry column. Can I do this for a base model and then extend?