Esempio n. 1
0
 /**
  * Deletes a participant.
  *
  * @param Poll $poll
  * @param string $participantId
  * @return void
  * @throws \Exception
  */
 public function deleteParticipant(Poll $poll, $participantId)
 {
     if (empty($poll->getAdminKey())) {
         throw new \Exception(sprintf('Admin key not available. Participant %s cannot be deleted.', $participantId), 1477378247);
     }
     $data = array('adminKey' => $poll->getAdminKey(), 'token' => $this->token);
     $response = $this->doPost('/np/new-polls/' . $poll->getId() . '/participants/' . $participantId . '/delete', $data);
 }
Esempio n. 2
0
 /**
  * Deletes a poll.
  *
  * @param Poll $poll
  * @return bool
  * @throws \Exception
  */
 public function deletePoll(Poll $poll)
 {
     if (empty($poll->getAdminKey())) {
         throw new \Exception(sprintf('Admin key not available. Poll %s cannot be deleted.', $poll->getId()), 1443782170);
     }
     $data = array('adminKey' => $poll->getAdminKey(), 'token' => $this->token);
     $response = $this->doPost('/np/new-polls/' . $poll->getId() . '/delete', $data);
 }