Injects the description of a given poll.

@param Poll $poll
@return void
764310
public function injectDescription(Poll $poll)
    {
        $info = $this->injectInfo($poll);
        $description = $this->decodeHtml($info['descriptionHTML']);
        $poll->setDescription($description);
    }
751109
public function getPoll($poll_id)
    {
        $this->checkId($poll_id);

        return $this->adapter->get(sprintf('/polls/%d', $poll_id));
    }
186829
public function podiumNew()
    {
        $transaction = static::getDb()->beginTransaction();
        try {
            if (!$this->save()) {
                throw new Exception('Thread saving error!');
            }

            $loggedIn = User::loggedId();

            if ($this->pollAdded && Podium::getInstance()->podiumConfig->get('allow_polls')) {
                $poll = new Poll();
                $poll->thread_id = $this->id;
                $poll->question = $this->pollQuestion;
                $poll->votes = $this->pollVotes;
                $poll->hidden = $this->pollHidden;
                $poll->end_at = !empty($this->pollEnd) ? Podium::getInstance()->formatter->asTimestamp($this->pollEnd . ' 23:59:59') : null;
                $poll->author_id = $loggedIn;
                if (!$poll->save()) {
                    throw new Exception('Poll saving error!');
                }

                foreach ($this->pollAnswers as $answer) {
                    $pollAnswer = new PollAnswer();
                    $pollAnswer->poll_id = $poll->id;
                    $pollAnswer->answer = $answer;
                    if (!$pollAnswer->save()) {
                        throw new Exception('Poll Answer saving error!');
                    }
                }
                Log::info('Poll added', $poll->id, __METHOD__);
            }

            $this->forum->updateCounters(['threads' => 1]);

            $post = new Post();
            $post->content = $this->post;
            $post->thread_id = $this->id;
            $post->forum_id = $this->forum_id;
            $post->author_id = $loggedIn;
            $post->likes = 0;
            $post->dislikes = 0;
            if (!$post->save()) {
                throw new Exception('Post saving error!');
            }

            $post->markSeen();
            $this->forum->updateCounters(['posts' => 1]);
            $this->updateCounters(['posts' => 1]);

            $this->touch('new_post_at');
            $this->touch('edited_post_at');

            if ($this->subscribe) {
                $subscription = new Subscription();
                $subscription->user_id = $loggedIn;
                $subscription->thread_id = $this->id;
                $subscription->post_seen = Subscription::POST_SEEN;
                if (!$subscription->save()) {
                    throw new Exception('Subscription saving error!');
                }
            }

            $transaction->commit();
            PodiumCache::clearAfter('newThread');
            Log::info('Thread added', $this->id, __METHOD__);
            return true;
        } catch (Exception $e) {
            $transaction->rollBack();
            Log::error($e->getMessage(), null, __METHOD__);
        }
        return false;
    }
339019
public function setDispatched($flag)
    {
        $this->dispatched = $flag ? true : false;

        if ($flag) {
            $this->emitRequestDispatched($this);
        }
    }
1339345
public function poll()
    {
        if (! app()->environment('production')) {
            $this->eye->status()->setHealthy('debug');
            return;
        }

        if (config('app.debug')) {
            if ($this->eye->status()->isHealthy('debug')) {
                $this->eye->notifier()->alert(new Enabled);
            }

            $this->eye->status()->setSick('debug');
        } else {
            if ($this->eye->status()->isSick('debug')) {
                $this->eye->notifier()->alert(new Disabled);
            }

            $this->eye->status()->setHealthy('debug');
        }
    }
878952
public function withoutFlag($flag): void
    {
        $flag = $this->parseFlag($flag);

        $this->flags = $this->flags & ~$flag;
    }
373878
public function pressButton($button)
    {
        $button = $this->fixStepArgument($button);
        $this->getSession()->getPage()->pressButton($button);
    }
991193
public function onVoterVote(VoteEvent $event)
    {
        $this->traceableAccessDecisionManager->addVoterVote($event->getVoter(), $event->getAttributes(), $event->getVote());
    }
137512
public function poll()
    {
        $this->checkForNewSchedulers();

        foreach ($this->getMissedSchedules() as $scheduler) {
            $this->notifyIfChanges($scheduler);
            $this->setNextSchedule($scheduler);
        }

        foreach ($this->getOverdueNoExitSchedules() as $history) {
            $history->output = "No finish ping received by Eyewitness";
            $history->exitcode = 1;
            $history->save();

            if ($history->scheduler->alert_on_fail || ($history->scheduler->alert_run_time_greater_than > 0)) {
                $this->eye->notifier()->alert(new Overdue(['scheduler' => $history->scheduler]));
            }
        }

        foreach ($this->getConditionalSchedules() as $scheduler) {
            if ($this->hasNotRunInGivenTimeframe($scheduler)) {
                $this->notifyIfChanges($scheduler);
            }
        }
    }
253831
public function onEvent(Event $event): void
    {
        if (!$event instanceof GetResponseEvent || !$this->injected) {
            if (null !== ($filter = $this->getFilter())) {
                $this->injectParameters($filter);
            }
        }
    }
651690
public function runCommand($command)
    {
        $this->setAutoExit(false);
        $argv = explode(' ','application '.$command);
        $input = new ArgvInput($argv);
        $this->run($input);
    }
478836
function() {
      var t = this;
      if (t.isModel) {
        t.value.off('change', t.poll, t);
      } else {
        PollingProbe.prototype.release.apply(t, arguments);
      }
    }
1186379
public function registerRoutes(Map $map)
    {
        $map->attach('legacy.', '/', function (Map $map) {
            $map->get('polls', 'polls/', $this->controller(PollsController::class, 'polls'))->allows(['POST']);
        });
    }
1221108
public function isVote(int $pollID): array
    {
        $usersService = app()->make('InetStudio\ACL\Users\Contracts\Services\Front\UsersServiceContract');
        $userID = $usersService->getUserId();

        $voteCookie = (bool) request()->cookie('poll_vote_'.$pollID, null);

        $userVote = $this->model::whereHas(
                'options',
                function (Builder $optionsQuery) use ($userID) {
                    $optionsQuery->whereHas(
                        'votes',
                        function (Builder $votesQuery) use ($userID) {
                            $votesQuery->where('user_id', '=', $userID);
                        }
                    );
                }
            )
            ->where('id', $pollID)
            ->first();

        $vote = ($userID > 0 && ! $voteCookie) ? ((bool) $userVote) : $voteCookie;

        return [
            'userID' => $userID,
            'vote' => $vote,
        ];
    }
953870
protected function insertRecord(Query $query): void
	{
		if($this->primaryKeyType === static::PRIMARY_KEY_TYPE_INCREMENTING)
		{
			$this->columns[$this->primaryKey] = $query->insertAndGetId($this->columns, $this->primaryKey);
		}
		else
		{
			switch($this->primaryKeyType)
			{
				case static::PRIMARY_KEY_TYPE_UUID:
					$this->columns[$this->primaryKey] = UUID::v4();
					break;
				case static::PRIMARY_KEY_TYPE_CUSTOM:
					$this->columns[$this->primaryKey] = $this->generatePrimaryKey();
					break;
			}

			$query->insert($this->columns);
		}
	}
1051834
public function unvote($voter)
    {
        $voteup = $this->voteups->getQuery(true)
                                ->disableChain()
                                ->voter($voter)
                                ->fetch();
        if ($voteup) {
            $voteup->delete();
        }
        $votedown = $this->votedowns->getQuery(true)
                                    ->disableChain()
                                    ->voter($voter)
                                    ->fetch();
        if ($votedown) {
            $votedown->delete();
        }
    }
587749
public function deleteParticipant(Poll $poll, int $participantid)
    {
        if (empty($poll->getAdminKey())) {
            throw new \Exception(sprintf('Admin key not available. Poll %s cannot be deleted.', $poll->getId()), 1443782170);
        }
        return $this->doDelete('/api/v2.0/polls/' . $poll->getId() . '/participants/' . $participantid . '?adminKey=' . $poll->getAdminKey());
    }