protected function doSave(PropelPDO $con) { $affectedRows = 0; if (!$this->alreadyInSave) { $this->alreadyInSave = true; if ($this->aAnio !== null) { if ($this->aAnio->isModified() || $this->aAnio->isNew()) { $affectedRows += $this->aAnio->save($con); } $this->setAnio($this->aAnio); } if ($this->aTurno !== null) { if ($this->aTurno->isModified() || $this->aTurno->isNew()) { $affectedRows += $this->aTurno->save($con); } $this->setTurno($this->aTurno); } if ($this->aOrientacion !== null) { if ($this->aOrientacion->isModified() || $this->aOrientacion->isNew()) { $affectedRows += $this->aOrientacion->save($con); } $this->setOrientacion($this->aOrientacion); } if ($this->isNew()) { $this->modifiedColumns[] = DivisionPeer::ID; } if ($this->isModified()) { if ($this->isNew()) { $pk = DivisionPeer::doInsert($this, $con); $affectedRows += 1; $this->setId($pk); $this->setNew(false); } else { $affectedRows += DivisionPeer::doUpdate($this, $con); } $this->resetModified(); } if ($this->collRelAlumnoDivisions !== null) { foreach ($this->collRelAlumnoDivisions as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } if ($this->collRelDivisionActividadDocentes !== null) { foreach ($this->collRelDivisionActividadDocentes as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } $this->alreadyInSave = false; } return $affectedRows; }