/** * 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->aCredit) { $this->aCredit->removePayment($this); } if (null !== $this->aCashier) { $this->aCashier->removeCreditPayment($this); } $this->id = null; $this->date = null; $this->credit_id = null; $this->cashier_id = null; $this->paid = null; $this->status = null; $this->alreadyInSave = false; $this->clearAllReferences(); $this->resetModified(); $this->setNew(true); $this->setDeleted(false); }