protected function doSave(PropelPDO $con) { $affectedRows = 0; if (!$this->alreadyInSave) { $this->alreadyInSave = true; if ($this->aUsuario !== null) { if ($this->aUsuario->isModified() || $this->aUsuario->isNew()) { $affectedRows += $this->aUsuario->save($con); } $this->setUsuario($this->aUsuario); } if ($this->aPermiso !== null) { if ($this->aPermiso->isModified() || $this->aPermiso->isNew()) { $affectedRows += $this->aPermiso->save($con); } $this->setPermiso($this->aPermiso); } if ($this->isModified()) { if ($this->isNew()) { $pk = UsuarioPermisoPeer::doInsert($this, $con); $affectedRows += 1; $this->setNew(false); } else { $affectedRows += UsuarioPermisoPeer::doUpdate($this, $con); } $this->resetModified(); } $this->alreadyInSave = false; } return $affectedRows; }