public function getAlreadyVoted($answer_nr) { if (!$this->m_data['allow_not_logged_in']) { // TODO duplicate fetch call... $vote = new DebateVote($this->m_data['debate_nr'], $answer_nr, $this->userId); $vote->fetch(); // --- if (is_numeric($vote->m_data['id_vote'])) { $this->alreadyVoted = $vote->m_data['fk_answer_nr']; } } return $this->alreadyVoted; }