public function asModel($class, $options = [])
{
$m = $this->newInstance($class, $options);
// Warning. If condition is different on both models,
// but the respective field's value is un-changed
// there might be some related issues.
$m->data = $this->data;
$m->dirty = $this->dirty;
$m->id = $this->id;
// next we need to go over fields to see if any system
// values have changed and mark them as dirty
return $m;
}