/** * @param Loan $loan **/ public function setLoan($loan) { $loan->addPayment($this); $this->loan = $loan; }