reset() public method

Replace modified fields with original
public reset ( )
Esempio n. 1
0
 /**
  * Reset all data passed to object in run-time, like events, behaviors,
  * data modifications, etc. to the state just after open or save document
  *
  * @return \Sokil\Mongo\Document
  */
 public function reset()
 {
     // reset structure
     parent::reset();
     // reset errors
     $this->errors = array();
     $this->triggeredErrors = array();
     // reset behaviors
     $this->clearBehaviors();
     // init delegates
     $this->initDocument();
     return $this;
 }
Esempio n. 2
0
 /**
  * Reset all data passed to object in run-time, like events, behaviors,
  * data modifications, etc. to the state just after open or save document
  *
  * @return \Sokil\Mongo\Document
  */
 public function reset()
 {
     // reset structure
     parent::reset();
     // reset errors
     $this->clearErrors();
     // reset behaviors
     $this->clearBehaviors();
     // init delegates
     $this->initDelegates();
     return $this;
 }