public function hasClass($class = null)
    {
        if ($class !== null) {
            $classes = explode(' ', $this->getClass());
            return in_array($class, $classes);
        } else {
            return $this->hasAttribute('class');
        }
    }
public function hasClass($class = null)
    {
        if ($class !== null) {
            $classes = explode(' ', $this->getClass());
            return in_array($class, $classes);
        } else {
            return $this->hasAttribute('class');
        }
    }
public function hasClass ( $ class = null ) { if ( $ class !== null ) { $ classes = explode ( ' ' , $ this -> getClass ( ) ) ; return in_array ( $ class , $ classes ) ; } else { return $ this -> hasAttribute ( 'class' ) ; } }
Determines whether element has a class

@param string $class
@return boolean
Determines whether element has a class