/** * Set model and all it's fields to unmodified */ public function setUnmodified() { $this->modified = false; foreach ($this->getFields() as $field) { $field->setUnmodified(); } if ($this->extends) { $this->extends->setUnmodified(); } }