protected function doSave($con) { $affectedRows = 0; if (!$this->alreadyInSave) { $this->alreadyInSave = true; if ($this->aPayerTypeRelatedByParent !== null) { if ($this->aPayerTypeRelatedByParent->isModified()) { $affectedRows += $this->aPayerTypeRelatedByParent->save($con); } $this->setPayerTypeRelatedByParent($this->aPayerTypeRelatedByParent); } if ($this->isModified()) { if ($this->isNew()) { $pk = PayerTypePeer::doInsert($this, $con); $affectedRows += 1; $this->setId($pk); $this->setNew(false); } else { $affectedRows += PayerTypePeer::doUpdate($this, $con); } $this->resetModified(); } if ($this->collPayerTypesRelatedByParent !== null) { foreach ($this->collPayerTypesRelatedByParent as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } if ($this->collVPayerTypes !== null) { foreach ($this->collVPayerTypes as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } if ($this->collAcademicCosts !== null) { foreach ($this->collAcademicCosts as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } if ($this->collVAcaCosts !== null) { foreach ($this->collVAcaCosts as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } if ($this->collVAcaCostElses !== null) { foreach ($this->collVAcaCostElses as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } if ($this->collStudentTypes !== null) { foreach ($this->collStudentTypes as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } if ($this->collVStudentTypes !== null) { foreach ($this->collVStudentTypes as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } $this->alreadyInSave = false; } return $affectedRows; }