protected function doSave(PropelPDO $con) { $affectedRows = 0; if (!$this->alreadyInSave) { $this->alreadyInSave = true; if ($this->aProvincia !== null) { if ($this->aProvincia->isModified() || $this->aProvincia->isNew()) { $affectedRows += $this->aProvincia->save($con); } $this->setProvincia($this->aProvincia); } if ($this->aTipolocacion !== null) { if ($this->aTipolocacion->isModified() || $this->aTipolocacion->isNew()) { $affectedRows += $this->aTipolocacion->save($con); } $this->setTipolocacion($this->aTipolocacion); } if ($this->isNew()) { $this->modifiedColumns[] = LocacionPeer::ID; } if ($this->isModified()) { if ($this->isNew()) { $pk = LocacionPeer::doInsert($this, $con); $affectedRows += 1; $this->setId($pk); $this->setNew(false); } else { $affectedRows += LocacionPeer::doUpdate($this, $con); } $this->resetModified(); } if ($this->collEspacios !== null) { foreach ($this->collEspacios as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } if ($this->collRelEstablecimientoLocacions !== null) { foreach ($this->collRelEstablecimientoLocacions as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } $this->alreadyInSave = false; } return $affectedRows; }