private function answer($query, $data, $relation) { $userId = OW::getUser()->getId(); $unvote = false; foreach ($query['answers']['yes'] as $optionId) { $this->service->addAnswer($userId, $optionId); $unvote = $data['poll']; } if (!empty($query['answers']['no'])) { $this->service->removeAnswerList($userId, $query['answers']['no']); } $answerCount = QUESTIONS_BOL_Service::getInstance()->findTotalAnswersCount($data['questionId']); if (!empty($relation)) { $relation = $this->reload(array('answerCount' => $answerCount), $relation['data']); } return array('relation' => $relation, 'status' => array('posts' => false, 'votes' => $answerCount, 'follows' => false), 'unvote' => $unvote); }