Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Eloquent/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public static function updateGeoAttributes($model)

}else if($model->$attrname instanceof $classname){
$model->tmp_geo[$attrname] = $model->$attrname;
$model->setAttribute( $attrname, \DB::rawGeo( $model->$attrname ));
$model->setAttribute( $attrname, $this->getConnection()->rawGeo( $model->$attrname ));

}else{
throw new \Exception('Geometry attribute ' . $attrname .' must be an instance of ' . $classname);
Expand Down Expand Up @@ -166,7 +166,7 @@ public function __get($key)
# 3) WKT: else
#
if(!ctype_print($data) or ctype_xdigit($data)){
$wkb = \DB::fromRawToWKB(parent::__get($key));
$wkb = $this->getConnection()->fromRawToWKB(parent::__get($key));
$this->setAttribute($key, $classname::fromWKB($wkb));

}else{ // assuming that it is in WKT
Expand All @@ -176,4 +176,4 @@ public function __get($key)
}
return parent::__get($key);
}
}
}