Repository navigation
1.0.27
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']);