Skip to content

1.0.27

Choose a tag to compare

@nums nums released this 10 Nov 13:43
· 25 commits to main since this release

Be able to create, list, update and remove Poll:

//create
$channel = $blastream->createOrGetChannel('my-channel');
$poll = [
  "choices"=>[ 
    ["id"=> 1, "value"=> "A", "color"=> "#FFA900" ],
    ["id"=> 2, "value"=> "B", "color"=> "#3EC59B" ]
  ],
  "format"=> "multiple", //can be ['multiple','quiz''note,'yes-no']
  "publish"=> 0,
  "question"=> "Question",
  "showResults"=> 1
];
$newPollData = $channel->createPool($poll);

//list
$channel->getPolls();

//update poll
$channel->updatePoll($newPollData['id'], [
  "choices"=>[ 
    ["id"=> 1, "value"=> "A", "color"=> "#FFA900" ],
    ["id"=> 2, "value"=> "B", "color"=> "#3EC59B" ]
    ["id"=> 3, "value"=> "C", "color"=> "#3EC59B" ]
  ],
  "format"=> "multiple",
  "publish"=> 0,
  "question"=> "Question updated",
  "showResults"=> 1
]);

//remove poll
$channel->removePoll($newPollData['id']);