Given a DOMNode representing an attribute, tries to map the data into
instance members.  If no mapping is defined, the name and value are
stored in an array.

@param DOMNode $attribute The DOMNode attribute needed to be handled
518909
protected function takeAttributeFromDOM($attribute)
    {
        switch ($attribute->localName) {
            case 'min':
                $this->_min = $attribute->nodeValue;
                break;
            case 'max':
                $this->_max = $attribute->nodeValue;
                break;
            case 'numRaters':
                $this->_numRaters = $attribute->nodeValue;
                break;
            case 'average':
                $this->_average = $attribute->nodeValue;
                break;
            case 'value':
                $this->_value = $attribute->nodeValue;
            default:
                parent::takeAttributeFromDOM($attribute);
        }
    }
976577
protected function takeAttributeFromDOM($attribute)
    {
        switch ($attribute->localName) {
        case 'etag':
            // ETags are special, since they can be conveyed by either the
            // HTTP ETag header or as an XML attribute.
            $etag = $attribute->nodeValue;
            if ($this->_etag === null) {
                $this->_etag = $etag;
            }
            elseif ($this->_etag != $etag) {
                require_once('Zend/Gdata/App/IOException.php');
                throw new Zend_Gdata_App_IOException("ETag mismatch");
            }
            break;
        default:
            parent::takeAttributeFromDOM($attribute);
            break;
        }
    }
1302418
public function setAttribute($attribute, $value)
    {
        //Check this attribute is support
        if (isset($this->input_map[$attribute])) {
            $this->input_map[$attribute] = $value;

            return $value;
        } else {
            throw new AttributeInvalidException('Attribute not supported by this library');
        }
    }
8792
public function setAttribute($attribute, $value){
        if($attribute === 'table'){
            $this->_table = $value;
        }
        elseif($attribute === 'pk'){
            $this->_pk = $value;
        }
        elseif($attribute === 'relations'){
            $this->_relations = $value;
        }
        
        return $this;
    }
981219
protected function checkAttributeNode(DOMAttr $attribute, Tag $tag)
	{
		// Parse the attribute value for XPath expressions and assess their safety
		foreach (AVTHelper::parse($attribute->value) as $token)
		{
			if ($token[0] === 'expression')
			{
				$this->checkExpression($attribute, $token[1], $tag);
			}
		}
	}
565229
function parseAttributes($attributes = array()) {
        foreach($attributes as $propertyName => $samlAttribute) {
            $this->parseUserAttribute($samlAttribute, $propertyName);
        }
    }
251088
protected function checkNode(DOMNode $node, Tag $tag)
	{
		if ($node instanceof DOMAttr)
		{
			$this->checkAttributeNode($node, $tag);
		}
		elseif ($node instanceof DOMElement)
		{
			if ($node->namespaceURI === self::XMLNS_XSL && $node->localName === 'copy-of')
			{
				$this->checkCopyOfNode($node, $tag);
			}
			else
			{
				$this->checkElementNode($node, $tag);
			}
		}
	}
824341
public function setAttributes($selector, array $attributes)
    {
        $nodes = $this->get($selector);

        foreach ($nodes as $node) {
            $node->setAttributes($attributes);
        }
    }
828828
protected static function DOMNodeValue(DOMNode $node, $associative = false, $attributes = false)
    {
        // Return the value immediately when we're dealing with a leaf
        // node without attributes or we simply don't want them included
        if (static::DOMNodeChildCount($node) == 0 && ($node->hasAttributes() === false || $attributes === false)) {
            return $node->nodeValue;
        }

        $children = array();

        if ($node->hasAttributes() && $attributes) {
            $children['@'] = static::DOMNodeAttributes($node);
        }

        foreach ($node->childNodes as $child) {
            // Skip text nodes containing whitespace
            if ($child instanceof DOMText && $child->isWhitespaceInElementContent()) {
                continue;
            }

            if (static::DOMNodeChildCount($child) > 0) {
                $value = static::DOMNodeValue($child, $associative);
            } else {
                $value = $child->nodeValue;
            }

            if ($associative) {
                $children[$child->nodeName][] = $value;
            } else {
                $children[] = $value;
            }
        }

        return $children;
    }
852902
public function attr($attribute)
    {
        if (!$this->nodes) {
            throw new \InvalidArgumentException('The current node list is empty.');
        }

        $node = $this->getNode(0);

        return $node->hasAttribute($attribute) ? $node->getAttribute($attribute) : null;
    }
1039993
public function setAttribute(NodeAttribute $attribute)
    {
        $this->attributes[$attribute->getName()] = $attribute;
        $this->tracker->logReplacement($attribute->getName());
    }
240724
public function attr($attribute)
    {
        if (!$this->attributes instanceof EntityAttributeContainer) {
            $this->attributes = $this->createEntityAttributeContainer();
        }

        return $this->attributes->attr($attribute);
    }
229011
protected function passesOptionalCheck($attribute)
    {
        if (! $this->hasRule($attribute, ['Sometimes'])) {
            return true;
        }

        $data = ValidationData::initializeAndGatherData($attribute, $this->data);

        return array_key_exists($attribute, $data)
            || array_key_exists($attribute, $this->data);
    }
314510
public function addAttribute($attribute)
    {
        $attributes = $this->getAttributes();
        array_push($attributes, $attribute);
        $this->setAttributes($attributes);
    }
284432
public function addAttribute($attribute, $value)
    {
        $this->attributes[$attribute] = (string) $value;
        $this->eventHandler->attributeAdded($this, $attribute, $value);
    }
1186342
public function addAttribute(Attribute $attribute)
    {
        $name = $attribute->getName();

        if (isset($this->attributes[$name])) {
            throw new \LogicException(sprintf('Attribute "%s" already defined.', $name));
        }

        $this->attributes[$name] = $attribute;
    }
552844
protected function validateAttribute (string $attribute=NULL) : bool
	{
		if (!property_exists($this, $attribute))
		{
			$this->error = "Attribute: ".ucfirst($attribute)." is not a class object.";
        	return FALSE;
		}
        $result = (is_array($this->$attribute)) ? !empty($this->$attribute) : Validate::hasValue($this->$attribute);
        if ($result) return TRUE;
		$this->error = "Set ".ucfirst($attribute)." to log your message.";
    	return FALSE;
	}