public function hasAnswer($answerId)
    {
        foreach ($this->answers as $answer) {
            if ($answer->id == $answerId) {
                return true;
            }
        }
        return false;
    }
public function hasAnswer($answerId)
    {
        foreach ($this->answers as $answer) {
            if ($answer->id == $answerId) {
                return true;
            }
        }
        return false;
    }
public function hasAnswer ( $ answerId ) { foreach ( $ this -> answers as $ answer ) { if ( $ answer -> id == $ answerId ) { return true ; } } return false ; }
Checks if poll has given answer.
@param int $answerId
@return bool
Checks if poll has given answer .