/** * Clears the current object, sets all attributes to their default values and removes * outgoing references as well as back-references (from other objects to this one. Results probably in a database * change of those foreign objects when you call `save` there). */ public function clear() { if (null !== $this->aUser) { $this->aUser->removeNote($this); } if (null !== $this->aCategory) { $this->aCategory->removeNote($this); } $this->id = null; $this->user_id = null; $this->importance = null; $this->title = null; $this->deadline = null; $this->category_id = null; $this->state = null; $this->repeat_after = null; $this->done_at = null; $this->public = null; $this->description = null; $this->created_at = null; $this->updated_at = null; $this->alreadyInSave = false; $this->clearAllReferences(); $this->applyDefaultValues(); $this->resetModified(); $this->setNew(true); $this->setDeleted(false); }