本文整理汇总了PHP中Poll::updateChoices方法的典型用法代码示例。如果您正苦于以下问题:PHP Poll::updateChoices方法的具体用法?PHP Poll::updateChoices怎么用?PHP Poll::updateChoices使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Poll
的用法示例。
在下文中一共展示了Poll::updateChoices方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: empty
$poll->access_id = $access_id;
$poll->question = $question;
$poll->title = $question;
$poll->description = $description;
$poll->open_poll = $open_poll ? 1 : 0;
$poll->close_date = empty($close_date) ? null : $close_date;
$poll->max_votes = $max_votes;
$poll->tags = string_to_tag_array($tags);
if (!$poll->save()) {
register_error(elgg_echo("poll:error"));
forward(REFERER);
}
if ($new) {
$poll->setChoices($new_choices);
} else {
$choices_changed = $poll->updateChoices($new_choices, $former_access_id);
// if poll choices have been modified and this poll has been created as multiple-anwer poll and
// such polls are currently not allowed then reset the max number of allowed votes to 1
if ($max_votes > 1 && $choices_changed) {
$multiple_answer_polls = elgg_get_plugin_setting('multiple_answer_polls', 'poll');
if ($multiple_answer_polls != "yes") {
$poll->max_votes = 1;
}
}
}
poll_manage_front_page($poll, $front_page);
elgg_clear_sticky_form('poll');
$poll_create_in_river = elgg_get_plugin_setting('create_in_river', 'poll');
if ($poll_create_in_river != 'no') {
if ($new) {
elgg_create_river_item(array('view' => 'river/object/poll/create', 'action_type' => 'create', 'subject_guid' => $user->guid, 'object_guid' => $poll->guid));