Hi, I have some Models which one of its field is a json data. My question is, how to elegantly transform the json data after the models being fetched? Is there somekind of afterFetch event?
class Settings extends \Phalcon\MVC\Model
{
$public $id;
$public $name,
$public $value; //json data
public function beforeSave(){
$this->value = json_encode($this->value);
}
//is there any kind of event like this???
public function afterFetch(){
$this->value = json_decode($this->value,true);
}
}