Initialize the product super attribute label with the passed attributes and returns an instance.

@param array $attr The product super attribute label attributes

@return array The initialized product super attribute label
189356
protected function initializeProductSuperAttributeLabel(array $attr)
    {

        // load product super attribute/store ID
        $storeId = $attr[MemberNames::STORE_ID];
        $productSuperAttributeId = $attr[MemberNames::PRODUCT_SUPER_ATTRIBUTE_ID];

        // query whether or not, the product super attribute label already exists
        if ($entity = $this->loadProductSuperAttributeLabel($productSuperAttributeId, $storeId)) {
            return $this->mergeEntity($entity, $attr);
        }

        // simply return the attributes
        return $attr;
    }
516466
protected function initializeUrlRewrite(array $attr)
    {

        // load the category ID of the passed URL rewrite entity
        $categoryId = $this->getCategoryIdFromMetadata($attr);

        // iterate over the available URL rewrites to find the one that matches the category ID
        foreach ($this->existingUrlRewrites as $urlRewrite) {
            // compare the category IDs AND the request path
            if ($categoryId === $this->getCategoryIdFromMetadata($urlRewrite) &&
                $attr[MemberNames::REQUEST_PATH] === $urlRewrite[MemberNames::REQUEST_PATH]
            ) {
                // if a URL rewrite has been found, do NOT create OR keep an existing redirect
                $this->removeExistingUrlRewrite($urlRewrite);

                // if the found URL rewrite has been created manually
                if ((integer) $urlRewrite[MemberNames::IS_AUTOGENERATED] === 0) {
                    // do NOT update it nor create another redirect
                    return false;
                }

                // if the found URL rewrite has been autogenerated, then update it
                return $this->mergeEntity($urlRewrite, $attr);
            }
        }

        // simple return the attributes
        return $attr;
    }
1066892
public function attribute( string $attr, string $value ): Tag
    {
        $this->attributes[$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;
    }
570674
public static function MergeAttr($attr, $_ = null)
  {
    $out = false;
    $arr = func_get_args();
    foreach ($arr as $v) {
      if (is_string($v)) {
        $v = array('class' => $v);
      }

      if (is_array($v)) {
        foreach ($v as $key => $val) {
          if ($key == 'style') {
            $val = static::ProcessStyle($val);
          }

          $val_arr = array();
          if (isset($out[$key])) {
            $val_arr[] = $out[$key];
          }
          $val_arr[] = $val;

          $out[$key] = join(' ', $val_arr);
        }
      }
    }

    return $out;
  }
1356288
private function attributesStr(array $attr)
    {
        $output = [];
        foreach ($attr as $name => $value) {
            $output[] = "{$name}=\"{$value}\"";
        }
        return implode(' ', $output);
    }
1163461
public function attr($attribute, $value = null)
    {
        if (is_array($attribute)) return $this->attributes($attribute);
        if ($value) return $this->attributes(array($attribute => $value));
    }
647436
protected function _buildAttribute($attr)
    {
        $string = array();

        foreach ($attr as $key => $value) {
            if (is_array($value)) {
                $value = implode(' ', $value);
            }

            $string[] = $key.'="'.$value.'"';
        }

        return implode(' ', $string);
    }
316720
private function parse_attributes($attr)
    {
        $html = '';

        if (!empty($attr)) {
            $html = '';

            foreach ($attr as $key => $value) {
                $html .= \sprintf('%s="%s" ', $key, \esc_attr($value));
            }
        }

        return \trim($html);
    }
1131118
static function input_attr(&$attr)
	{
	    $str = " ";
        if(!empty($attr) && is_array($attr))
        {
            foreach($attr as $key=>$value)
            {
                $str .= "$key=\"$value\" ";
            }
        }
        return $str;
	}
1128688
public function attributeWas($attr)
    {
        return $this->attributeChanged($attr) ?
                $this->changedAttributes[$attr] :
                $this->getAttribute($attr);
    }
8676
public function attr_first($css, $attr)
    {
        $nodes = $this->_document->getQuery()->css($css, $this->_node);
        return $nodes ? $nodes->item(0)->getAttribute($attr) : null;
    }
566229
public static function attr( $attr = array() ) {
		$buffer = " ";
		foreach( $attr as $key => $value ) {	
			$buffer .= $key.'="'.$value.'" ';
		}
	
		return substr( $buffer, 0, -1 );
	}
567213
public function attributes(array $attr)
    {
        $attr_string = '';
        foreach ($attr as $name => $value) {
            if (is_array($value)) {
                $attr_string .= ' '.$name.'="'.implode(' ', $value).'"';
            } else {
                $attr_string .= ' '.$name.'="'.$value.'"';
            }
        }

        return $attr_string;
    }
323355
public function getSymbol($attr)
    {
        return \array_key_exists($this->style, self::$enSymbols) && \array_key_exists($attr, self::$enSymbols[$this->style]) ? self::$enSymbols[$this->style][$attr] : false;
    }
1105009
public function setter($attr)
    {
        if (isset($this->_setters[$attr])) {
            return $this->_setters[$attr];
        } elseif (isset($this->_props[$attr])) {
            return $this->_props[$attr]->setter($attr);
        } elseif (isset($this->_rels[$attr])) {
            return $this->_rels[$attr]->setter($attr);
        }

        throw new Exception("No setter available for $attr");
    }
541569
protected function initializeStockItem(array $attr)
    {

        // load the stock item with the passed item/product/stock ID
        $entity = $this->loadStockItem(
            $attr[MemberNames::PRODUCT_ID],
            $attr[MemberNames::WEBSITE_ID],
            $attr[MemberNames::STOCK_ID]
        );

        // merge the attributes with the entity, if available
        if ($entity) {
            return $this->mergeEntity($entity, $attr);
        }

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