get an attribute, if the attribute was not set previously a
default value can be supplied

@param string $attr
@param string $default
@return string
498456
public function getAttribute($attr, $default = null) {
		
		return ($attr && array_key_exists($attr, $this->attributes)) ? $this->attributes[$attr] : $default;
		
	}
133424
public function attr($attribute = null)
    {
        if ($this->isNull($attribute)) {
            return $this->attribute;
        }

        return $this->parent->attr($attribute);
    }
59273
protected function getAttributesInput(array $attr)
    {
        $output = [];
        foreach ($attr as $key => $values) {
            if (empty($values)) {
                continue;
            }
            if (in_array($key, $this->attributesUnique)) {
                $output[] = $key;
            } elseif (!in_array($key, $this->attributesCss) && $key !== 'selected') {
                $output[] = $key . '="' . $values . '"';
            }
        }
        $implode = implode(' ', $output);

        return $implode
            ? " $implode"
            : '';
    }
714843
public function attr()
    {
        $args = func_get_args();

        if (isset($args[0]) && is_array($args[0])) {
            $this->attributes = array_merge($this->attributes, $args[0]);

            return $this;
        } elseif (isset($args[0]) && isset($args[1])) {
            $this->attributes[$args[0]] = $args[1];

            return $this;
        } elseif (isset($args[0])) {
            return isset($this->attributes[$args[0]]) ? $this->attributes[$args[0]] : null;
        }

        return $this->attributes;
    }
134463
public function attr(string $name, $value = null) {
        if (is_null($value)) {
            return $this->getAttr($name);
        } else {
            return $this->setAttr($name, $value);
        }
    }
1128688
public function attributeWas($attr)
    {
        return $this->attributeChanged($attr) ?
                $this->changedAttributes[$attr] :
                $this->getAttribute($attr);
    }
305511
public function getAttribute($attribute, $default = NULL) {

		if (!$this->attributes || !array_key_exists(strtolower($attribute), $this->attributes)) {
			return $default;
		}
		return $this->attributes[strtolower($attribute)];
	
	}
1364796
public function attribute($attr, $value = '')
    {
        if (is_array($attr)) {
            foreach ($attr as $key => $value) {
                $this->attribute($key, $value);
            }
        } else {
            $this->attributes[$attr] = $value;
        }

        return $this;
    }
488864
public function getAttribute($name, $default = null)
    {
        $value = $default;
        if ($this->hasAttribute($name)) {
            $value = $this->attributes->get($name);
        }
        return $value;
    }
632411
public function getDbAttribute($attribute, $default = null)
    {
        return isset($this->_dbAttributes[$attribute]) ? $this->_dbAttributes[$attribute] : $default;
    }
1099532
public function getAttribute($key = null, $default = null){
        if (is_null($key)) {
            return $this->getAllAttributes();
        }
        $method = sprintf('get%sAttribute', Str::studly($key));
        if (isset($this->dynamic_attributes[$method])
            || array_key_exists($method, $this->dynamic_attributes)) {
            return $this->dynamic_attributes[$method];
        }
        if (method_exists($this, $method)) {
            return $this->dynamic_attributes[$method]
                = call_user_func([$this, $method]);
        }
        if ($this->has($key)) {
            return $this->__attributes[$key];
        }
        if ($this->relationLoaded($key)) {
            return $this->relations[$key];
        }
        if (!method_exists($this, $key)) {
            return $default;
        }
        return $this->getRelationValue($key);
    }
317273
public function get($name, $default = null)
    {
        return isset($this->attributes[$name]) ? $this->attributes[$name] : $default;
    }
1076205
protected function _getAttr($oc, $attr)
    {
        $oc = strtolower($oc);
        if (key_exists($oc, $this->_objectClasses) && key_exists($attr, $this->_objectClasses[$oc])) {
            return $this->_objectClasses[$oc][$attr];
        } elseif (key_exists($oc, $this->_oids) &&
                $this->_oids[$oc]['type'] == 'objectclass' &&
                key_exists($attr, $this->_oids[$oc])) {
            return $this->_oids[$oc][$attr];
        } else {
            return PEAR::raiseError("Could not find $attr attributes for $oc ");
        }
    }
72152
public function get_attribute($key, $default = null)
	{
		$attributes = $this->get_config('form_attributes', array());

		return array_key_exists($key, $attributes) ? $attributes[$key] : $default;
	}
288982
public function getAttribute( string $name, $defaultValue = false )
   {

      if ( ! $this->hasAttribute( $name ) )
      {
         return $defaultValue;
      }

      return $this->_attributes[ $name ];

   }
1340091
public function attr($name, $value = null){
        if(is_null($value)){
            return $this->getAttributeValue($name);
        }else{
            return $this->setAttribute($name, $value);
        }
    }
71078
public function getAttribute($name, $default = null)
    {
        if (empty($this->attribs[$name])) {
            return $default;
        }

        return $this->attribs[$name];
    }