protected function doSave(PropelPDO $con) { $affectedRows = 0; if (!$this->alreadyInSave) { $this->alreadyInSave = true; if ($this->aAlumno !== null) { if ($this->aAlumno->isModified() || $this->aAlumno->isNew()) { $affectedRows += $this->aAlumno->save($con); } $this->setAlumno($this->aAlumno); } if ($this->aUsuario !== null) { if ($this->aUsuario->isModified() || $this->aUsuario->isNew()) { $affectedRows += $this->aUsuario->save($con); } $this->setUsuario($this->aUsuario); } if ($this->aLegajocategoria !== null) { if ($this->aLegajocategoria->isModified() || $this->aLegajocategoria->isNew()) { $affectedRows += $this->aLegajocategoria->save($con); } $this->setLegajocategoria($this->aLegajocategoria); } if ($this->isNew()) { $this->modifiedColumns[] = LegajopedagogicoPeer::ID; } if ($this->isModified()) { if ($this->isNew()) { $pk = LegajopedagogicoPeer::doInsert($this, $con); $affectedRows += 1; $this->setId($pk); $this->setNew(false); } else { $affectedRows += LegajopedagogicoPeer::doUpdate($this, $con); } $this->resetModified(); } if ($this->collLegajoadjuntos !== null) { foreach ($this->collLegajoadjuntos as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } $this->alreadyInSave = false; } return $affectedRows; }