Modified or before value in model

In rails there is a notion of modified? value if the record is modified.

I donĀ“t find any reference in documentation to acess before values (was in rails).

i can add this with afterFetch keep value and check in beforesave to know if value has change. is there any other solution ?



4.0k
edited Apr '14

I didn't see it before, but this is the functionnality i need.

In the documentation, i can't see how get before values, i can only check if the value has change. I find this in C files : getSnapshotData but it's missing in the documentation

And i have a bug, i use it like this

class Product extends Phalcon\Mvc\Model {
  public function initialize(){
    $this->keepSnapshots(true);
  }
  public function afterSave(){
    print_r($this->getChangedFields());
    exit();
  }
}

And i get many fields of other model, not only the product model.