public function hasAttributeValue($name, $value = null)
    {
        if (!$this->hasAttribute($name)) {
            return false;
        }
        return (empty($value))? true : (array_search($value, $this->getArrayAttribute($name)) !== false);
    }