protected function doSave($con) { $affectedRows = 0; if (!$this->alreadyInSave) { $this->alreadyInSave = true; if ($this->aPaymentJournal !== null) { if ($this->aPaymentJournal->isModified()) { $affectedRows += $this->aPaymentJournal->save($con); } $this->setPaymentJournal($this->aPaymentJournal); } if ($this->aAcademicCost !== null) { if ($this->aAcademicCost->isModified()) { $affectedRows += $this->aAcademicCost->save($con); } $this->setAcademicCost($this->aAcademicCost); } if ($this->isModified()) { if ($this->isNew()) { $pk = PaymentHistoryPeer::doInsert($this, $con); $affectedRows += 1; $this->setId($pk); $this->setNew(false); } else { $affectedRows += PaymentHistoryPeer::doUpdate($this, $con); } $this->resetModified(); } $this->alreadyInSave = false; } return $affectedRows; }