protected function doSave(PropelPDO $con) { $affectedRows = 0; if (!$this->alreadyInSave) { $this->alreadyInSave = true; if ($this->aTipodocumento !== null) { if ($this->aTipodocumento->isModified() || $this->aTipodocumento->isNew()) { $affectedRows += $this->aTipodocumento->save($con); } $this->setTipodocumento($this->aTipodocumento); } if ($this->aProvincia !== null) { if ($this->aProvincia->isModified() || $this->aProvincia->isNew()) { $affectedRows += $this->aProvincia->save($con); } $this->setProvincia($this->aProvincia); } if ($this->aPais !== null) { if ($this->aPais->isModified() || $this->aPais->isNew()) { $affectedRows += $this->aPais->save($con); } $this->setPais($this->aPais); } if ($this->isNew()) { $this->modifiedColumns[] = DocentePeer::ID; } if ($this->isModified()) { if ($this->isNew()) { $pk = DocentePeer::doInsert($this, $con); $affectedRows += 1; $this->setId($pk); $this->setNew(false); } else { $affectedRows += DocentePeer::doUpdate($this, $con); } $this->resetModified(); } if ($this->collRelDivisionActividadDocentes !== null) { foreach ($this->collRelDivisionActividadDocentes as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } if ($this->collRelDocenteEstablecimientos !== null) { foreach ($this->collRelDocenteEstablecimientos as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } if ($this->collDocenteHorarios !== null) { foreach ($this->collDocenteHorarios as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } if ($this->collRelAnioActividadDocentes !== null) { foreach ($this->collRelAnioActividadDocentes as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } $this->alreadyInSave = false; } return $affectedRows; }