/** * 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->aGames) { $this->aGames->removeRatingHeaders($this); } if (null !== $this->aUser) { $this->aUser->removeRatingHeaders($this); } if (null !== $this->aRigs) { $this->aRigs->removeRatingHeaders($this); } if (null !== $this->aPlatforms) { $this->aPlatforms->removeRatingHeaders($this); } $this->id = null; $this->game_id = null; $this->user_id = null; $this->game_platform_id = null; $this->rig_id = null; $this->created = null; $this->updated = null; $this->upvotes = null; $this->downvotes = null; $this->comments = null; $this->score = null; $this->alreadyInSave = false; $this->clearAllReferences(); $this->applyDefaultValues(); $this->resetModified(); $this->setNew(true); $this->setDeleted(false); }