protected function doSave(PropelPDO $con) { $affectedRows = 0; if (!$this->alreadyInSave) { $this->alreadyInSave = true; if ($this->aCiclolectivo !== null) { if ($this->aCiclolectivo->isModified() || $this->aCiclolectivo->isNew()) { $affectedRows += $this->aCiclolectivo->save($con); } $this->setCiclolectivo($this->aCiclolectivo); } if ($this->isNew()) { $this->modifiedColumns[] = TurnoPeer::ID; } if ($this->isModified()) { if ($this->isNew()) { $pk = TurnoPeer::doInsert($this, $con); $affectedRows += 1; $this->setId($pk); $this->setNew(false); } else { $affectedRows += TurnoPeer::doUpdate($this, $con); } $this->resetModified(); } if ($this->collDivisions !== null) { foreach ($this->collDivisions as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } if ($this->collHorarioescolars !== null) { foreach ($this->collHorarioescolars as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } $this->alreadyInSave = false; } return $affectedRows; }