User Tools

Site Tools


mantis:cloudapp:issue:187

PUT /ocs/v2.php/apps/polls/api/v1.0/poll/{pollId}

Update poll

States: 200, 403, 404, 409


  {
      "poll": {
          "title": "Changed Title",
          "description": "Updated description",
          "expire": 0,
          "deleted": 0,
          "access": "hidden",
          "anonymous": 1,
          "allowMaybe": 1,
          "showResults": "never",
          "adminAccess": 1
      }
  }
  

  public function deserializeArray(array $pollConfiguration): self {
      $this->setTitle($pollConfiguration['title'] ?? $this->getTitle());
      $this->setDescription($pollConfiguration['description'] ?? $this->getDescription());
      $this->setAccess($pollConfiguration['access'] ?? $this->getAccess());
      $this->setAllowComment($pollConfiguration['allowComment'] ?? $this->getAllowComment());
      $this->setAllowMaybe($pollConfiguration['allowMaybe'] ?? $this->getAllowMaybe());
      $this->setAllowProposals($pollConfiguration['allowProposals'] ?? $this->getAllowProposals());
      $this->setAnonymousSafe($pollConfiguration['anonymous'] ?? $this->getAnonymous());
      $this->setAutoReminder($pollConfiguration['autoReminder'] ?? $this->getAutoReminder());
      $this->setCollapseDescription($pollConfiguration['collapseDescription'] ?? $this->getCollapseDescription());
      $this->setExpire($pollConfiguration['expire'] ?? $this->getExpire());
      $this->setForceConfidentialComments($pollConfiguration['forceConfidentialComments'] ?? $this->getForceConfidentialComments());
      $this->setHideBookedUp($pollConfiguration['hideBookedUp'] ?? $this->getHideBookedUp());
      $this->setProposalsExpire($pollConfiguration['proposalsExpire'] ?? $this->getProposalsExpire());
      $this->setShowResults($pollConfiguration['showResults'] ?? $this->getShowResults());
      $this->setForcedDisplayMode($pollConfiguration['forcedDisplayMode'] ?? $this->getForcedDisplayMode());
      $this->setUseNo($pollConfiguration['useNo'] ?? $this->getUseNo());
      $this->setOptionLimit($pollConfiguration['maxVotesPerOption'] ?? $this->getOptionLimit());
      $this->setVoteLimit($pollConfiguration['maxVotesPerUser'] ?? $this->getVoteLimit());
      return $this;
  }

mantis/cloudapp/issue/187.txt · Last modified: by domjos