Set active item link.

@param array $attr
@return array
557153
protected function _setActive(array $attr = [])
    {
        if ($this->Url->build(self::$_itemParams['item']['url']) == env('REQUEST_URI')) {
            $attr = $this->addClass($attr, 'active');
        }

        return $attr;
    }
781612
protected function initializeBundleOptionValue(array $attr)
    {

        // load and map the parent option ID
        $parentId = $this->mapSku($this->getValue(ColumnKeys::BUNDLE_PARENT_SKU));

        // load the parent ID, the name and the store ID
        $name = $this->getValue(ColumnKeys::BUNDLE_VALUE_NAME);
        $storeId = $this->getRowStoreId(StoreViewCodes::ADMIN);

        // try to load the bundle option value with the passed name/store/parent ID
        if ($this->loadBundleOptionValue($name, $storeId, $parentId)) {
            return;
        }

        // simply return the attributes
        return $attr;
    }
74553
function getAttribute($attr)
    {
        $attr = strtolower($attr);
        if (isset($this->_attributes[$attr])) {
            return $this->_attributes[$attr];
        }
        return null;
    }
800228
protected function initializeProduct(array $attr)
    {

        // load the product with the passed SKU and merge it with the attributes
        if ($entity = $this->loadProduct($attr[MemberNames::SKU])) {
            return $this->mergeEntity($entity, $attr);
        }

        // otherwise simply return the attributes
        return $attr;
    }
275811
public function deleteAttribute($attr) {
        $url = "entities/{$this->_id}/attrs/$attr";

        if ($this->_type) {
            $url .= "?type={$this->_type}";
        }

        return $this->_orion->delete($url);
    }
1128688
public function attributeWas($attr)
    {
        return $this->attributeChanged($attr) ?
                $this->changedAttributes[$attr] :
                $this->getAttribute($attr);
    }
102607
public function set_attribute($attr, $value = null)
	{
		$attr = is_array($attr) ? $attr : array($attr => $value);
		foreach ($attr as $key => $value)
		{
			if ($value === null)
			{
				unset($this->attributes[$key]);
			}
			else
			{
				$this->attributes[$key] = $value;
			}
		}

		return $this;
	}
93956
public function setTrans($attr, $trans = null)
    {
        $transList = is_array($attr)
            ? $attr
            : [$attr => $trans];

        foreach ($transList as $key => $value)
            $this->trans[$key] = $value;

        return $this;
    }
1069696
public static function getKeyAlias(array &$attr)
    {
        foreach (TagInfo::$attrKeyAliases as $alias => $key) {
            if (strpos($attr[0], $alias) === 0) {
                return compact('key', 'alias');
            }
        }

        return false;
    }
804172
public function setPicturesAttribute(array $attr)
    {
        $current = $this->image;
        $image = Images::parse($attr)->on($this->storageFolder());

        if ($image->wantsDeletion()) {
            $image->delete($current);
            return $this->attributes['image'] = null;
        }

        $picture = $image->update($current);

        return $this->attributes['image'] = $picture['path'];
    }
24533
protected function initializeProductSuperLink(array $attr)
    {

        // laod parent/product ID
        $parentId = $attr[MemberNames::PARENT_ID];
        $productId = $attr[MemberNames::PRODUCT_ID];

        // query whether or not the product super link already exists
        if ($this->loadProductSuperLink($productId, $parentId)) {
            return;
        }

        // simply return the attributes
        return $attr;
    }
559718
protected function fixInternalAttr(array $attr = null)
    {
        $attr = (array) $attr;

        $base = array(
            'type' => 'text/css',
            'media' => 'screen',
        );

        unset($attr['rel']);
        unset($attr['href']);

        return array_merge($base, (array) $attr);
    }
365073
public function removeAttribute( string $attr ): Tag
    {
        if ( isset( $this->attributes[$attr] ) ) {
            unset( $this->attributes[$attr] );
        }

        return $this;
    }
257577
public function set_session($attr){
    if ( $this->session->has(self::$un) ){
      $args = \func_get_args();
      if ( (\count($args) === 2) && \is_string($args[0]) ){
        $attr = [$args[0] => $args[1]];
      }
      foreach ( $attr as $key => $val ){
        if ( \is_string($key) ){
          $this->session->set($val, self::$un, $key);
        }
      }
    }
    return $this;
  }
1062482
public function get($attr,$current=true)
    {
        if (!$this->_data || !array_key_exists($attr, $this->_data)) {
            return null;
        }
        return Connection::convertToEncoding($current ? $this->_data[$attr] : $this->_prev_data[$attr]);
    }
1106181
public function setElementsAttr($attr, $value) {
		foreach ($this->getElements() as $element) {
			if ($element instanceof Tag) {
				$element->setAttr($attr, $value);
			}
		}
		
		return $this;
	}
1131164
protected function initializeAttribute(array $attr)
    {

        // try to load the attribute with the passed attribute ID and merge it with the attributes
        if (isset($this->attributes[$attributeId = (integer) $attr[MemberNames::ATTRIBUTE_ID]])) {
            return $this->mergeEntity($this->attributes[$attributeId], $attr);
        }

        // otherwise simply return the attributes
        return $attr;
    }