protected function doSave($con) { $affectedRows = 0; if (!$this->alreadyInSave) { $this->alreadyInSave = true; if ($this->aDepartment !== null) { if ($this->aDepartment->isModified()) { $affectedRows += $this->aDepartment->save($con); } $this->setDepartment($this->aDepartment); } if ($this->isModified()) { if ($this->isNew()) { $pk = BankAccountPeer::doInsert($this, $con); $affectedRows += 1; $this->setId($pk); $this->setNew(false); } else { $affectedRows += BankAccountPeer::doUpdate($this, $con); } $this->resetModified(); } if ($this->collAcademicCosts !== null) { foreach ($this->collAcademicCosts as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } $this->alreadyInSave = false; } return $affectedRows; }