Este metodo permite concatenar un objeto de atributos en una sola cadena.
@param  attay $attrs Arreglo de atributos.
@return string
546323
private function attrs_to_string($attrs)
    {
        $attrs_string ='';

        foreach($attrs as $name => $node)
        {
            $attrs_string.= sprintf(' %s="%s"',$name,$node->nodeValue);
        }

        return $attrs_string;
    }
425020
private static function getAttributes($attr)
    {
        $html = "";
        foreach ($attr as $key => $value) {
            $html .= $key . '="' . $value . '" ';
        }

        return $html;
    }
849911
protected function getMethodFromAttributes($attrs)
    {
        if (!is_array($attrs) || !isset($attrs['method'])) {
            return $this->getEventFromAttributes($attrs);
        }

        return $attrs['method'];
    }
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);
    }
1298984
public function getAttribute($attr) {
        $url = "entities/{$this->_id}/attrs/$attr";

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

        return $this->_orion->get($url);
    }
777053
private function _index_attribs($attrs)
    {
        $this->attr_idx = $this->attrs = $aix = $six = $iix = $iax = self::$_ar_;
        $i              = 0;
        $ian            = self::$_index_attribs;
        foreach ($ian as $atn) {
            if (!isset($iax[$atn])) {
                $iax[$atn] = self::$_ar_;
            }
        }

        foreach ($attrs as $str => $v) {
            $a = self::html_parseAttrStr($str, true, false);
            unset($attrs[$str]); // free mem
            foreach ($ian as $atn) {
                if (isset($a[$atn])) {
                    // href attribute has a separate index
                    if (is_array($v)) {
                        foreach ($v as $e) {
                            $iax[$atn][$e] = $a[$atn];
                        }

                    } else {
                        $iax[$atn][$v] = $a[$atn];
                    }
                    unset($a[$atn]);
                }
            }
            if (empty($a)) {
                continue;
            }

            $str = self::html_attr2str($a);
            $aid = $i;
            if (isset($six[$str])) {
                $aid = $six[$str];
                if (!is_array($iix[$aid])) {
                    $iix[$aid] = array($iix[$aid]);
                }

                if (is_array($v)) {
                    foreach ($v as $v_) {
                        $iix[$aid][] = $v_;
                    }
                } else {
                    $iix[$aid][] = $v;
                }

            } else {
                $six[$str] = $aid;
                $aix[$aid] = $a;
                $iix[$aid] = $v;
                ++$i;
            }
        }
        unset($six, $attrs, $i); // free mem
        foreach ($aix as $aid => $a) {
            $v = $iix[$aid];
            if (is_array($v)) {
                if (count($v) == 1) {
                    $v = reset($v);
                } elseif ($v) {
                    $u = array();
                    foreach ($v as $e) {
                        $u[$e]           = $this->ids[$e];
                        $this->attrs[$e] = $aid;
                    }
                    $v = $u;unset($u);
                }
            }
            if (!is_array($v)) {
                $this->attrs[$v] = $aid;
            }

            $this->attr_idx[$aid] = $v; // ids for this attr
        }
        foreach ($iax as $atn => $v) {
            if (!$v) {
                unset($iax[$atn]);
            }
        }

        $this->idx_attr = $iax;
        $this->attribs  = $aix;

        return $this->attr_idx;
    }
501335
public function prepare(&$attrs)
    {
        $attrs['type'] = $this->type ?: 'text';
        $attrs['name'] = $this->getFieldName();
        $attrs['id'] = $this->getAttribute('id', $this->getId());
        $attrs['class'] = $this->getAttribute('class');
        $attrs['placeholder'] = $this->getAttribute('placeholder');
        $attrs['size'] = $this->getAttribute('size');
        $attrs['maxlength'] = $this->getAttribute('maxlength');
        $attrs['readonly'] = $this->getAttribute('readonly');
        $attrs['disabled'] = $this->getAttribute('disabled');
        $attrs['autofocus'] = $this->getAttribute('autofocus');
        $attrs['autocomplete'] = $this->getAttribute('autocomplete');
        $attrs['form'] = $this->getAttribute('form');
        $attrs['formenctype'] = $this->getAttribute('formenctype');
        $attrs['formmethod'] = $this->getAttribute('formmethod');
        $attrs['formnovalidate'] = $this->getAttribute('formnovalidate');
        $attrs['formtarget'] = $this->getAttribute('formtarget');
        $attrs['onchange'] = $this->getAttribute('onchange');
        $attrs['onfocus'] = $this->getAttribute('onfocus');
        $attrs['onblur'] = $this->getAttribute('onblur');
        $attrs['value'] = $this->escape($this->getValue());
        $attrs['list'] = $this->getAttribute('list', count($this->options) ? $this->getId() . '-list' : null);

        $attrs['required'] = $this->required;
    }
1331530
public function getInjects(&$attr)
    {
        $inject = array(
            'before' => '',
            'between' => '',
            'after' => ''
        );

        if (! empty($attr['before'])) {
            $inject['before'] = $attr['before'];
            unset($attr['before']);
        }

        if (! empty($attr['between'])) {
            $inject['between'] = $attr['between'];
            unset($attr['between']);
        }

        if (! empty($attr['after'])) {
            $inject['after'] = $attr['after'];
            unset($attr['after']);
        }

        return $inject;
    }
356889
public function prepare(&$attrs)
    {
        parent::prepare($attrs);

        $attrs['max'] = $this->getAttribute('max');
        $attrs['min'] = $this->getAttribute('min');
        $attrs['step'] = $this->getAttribute('step');
        $attrs['patten'] = $this->getAttribute('pattern');
    }
657908
public function getAttribute($attr)
    {
        return isset($this->attributes[$attr]) ? $this->attributes[$attr] : null;
    }
1125740
public function attribute( $attr )
    {
        switch( $attr )
        {
            case 'responseHeader':
            {
                return $this->ResultArray['responseHeader'];
            } break;

            case 'hasError':
            {
                return !empty( $this->ResultArray['error'] );
            } break;

            case 'error':
            {
                if ( !empty( $this->ResultArray['error'] ) )
                {
                    return $this->ResultArray['error'];
                }
            } break;

            case 'facet_queries':
            {
                if ( !empty( $this->FacetQueries ) )
                {
                    return $this->FacetQueries;
                }

                // If the facets count is empty, an error has occured.
                if ( empty( $this->ResultArray['facet_counts'] ) )
                {
                    return null;
                }

                $facetArray = array();
                foreach ( $this->ResultArray['facet_counts']['facet_queries'] as $query => $count )
                {
                    list( $field, $fieldValue ) = explode( ':', $query );
                    $fieldInfo = array( 'field' => $field,
                                        'count' => $count,
                                        'queryLimit' => $query,
                                        'fieldValue' => $fieldValue );
                    $facetArray[] = $fieldInfo;
                }

                $this->FacetQueries = $facetArray;
                return $this->FacetQueries;
            } break;

            case 'facet_fields':
            {
                if ( !empty( $this->FacetFields ) )
                {
                    return $this->FacetFields;
                }

                // If the facets count is empty, an error has occured.
                if ( empty( $this->ResultArray['facet_counts'] ) )
                {
                    return null;
                }

                $facetArray = array();
                foreach ( $this->ResultArray['facet_counts']['facet_fields'] as $field => $facetField )
                {
                    switch( $field )
                    {
                        // class facet field
                        case eZSolr::getMetaFieldName( 'contentclass_id' ):
                        {
                            $fieldInfo = array( 'field' => 'class',
                                                'count' => count( $facetField ),
                                                'nameList' => array(),
                                                'queryLimit' => array(),
                                                'fieldList' => array(),
                                                'countList' => array() );
                            foreach ( $facetField as $contentClassID => $count )
                            {
                                if ( $contentClass = eZContentClass::fetch( $contentClassID ) )
                                {
                                    $fieldInfo['nameList'][$contentClassID] = $contentClass->attribute( 'name' );
                                    $fieldInfo['queryLimit'][$contentClassID] = 'contentclass_id:' . $contentClassID;
                                    $fieldInfo['countList'][$contentClassID] = $count;
                                    $fieldInfo['fieldList'][$contentClassID] = 'contentclass_id';
                                }
                                else
                                {
                                    eZDebug::writeWarning( 'Could not fetch eZContentClass: ' . $contentClassID, __METHOD__ );
                                }
                            }
                            $facetArray[] = $fieldInfo;
                        } break;

                        // instalaltion facet field
                        case eZSolr::getMetaFieldName( 'installation_id' ):
                        {
                            $findINI = eZINI::instance( 'ezfind.ini' );
                            $siteNameMapList = $findINI->variable( 'FacetSettings', 'SiteNameList' );
                            $fieldInfo = array( 'field' => 'installation',
                                                'count' => count( $facetField ),
                                                'nameList' => array(),
                                                'queryLimit' => array(),
                                                'fieldList' => array(),
                                                'countList' => array() );
                            foreach ( $facetField as $installationID => $count )
                            {
                                $fieldInfo['nameList'][$installationID] = isset( $siteNameMapList[$installationID] ) ?
                                    $siteNameMapList[$installationID] : $installationID;
                                $fieldInfo['queryLimit'][$installationID] = 'installation_id:' . $installationID;
                                $fieldInfo['countList'][$installationID] = $count;
                                $fieldInfo['fieldList'][$installationID] = 'installation_id';
                            }
                            $facetArray[] = $fieldInfo;
                        } break;

                        // author facet field
                        case eZSolr::getMetaFieldName( 'owner_id' ):
                        {
                            $fieldInfo = array( 'field' => 'author',
                                                'count' => count( $facetField ),
                                                'nameList' => array(),
                                                'queryLimit' => array(),
                                                'fieldList' => array(),
                                                'countList' => array() );
                            foreach ( $facetField as $ownerID => $count )
                            {
                                if ( $owner = eZContentObject::fetch( $ownerID ) )
                                {
                                    $fieldInfo['nameList'][$ownerID] = $owner->attribute( 'name' );
                                    $fieldInfo['queryLimit'][$ownerID] = 'owner_id:' . $ownerID;
                                    $fieldInfo['countList'][$ownerID] = $count;
                                    $fieldInfo['fieldList'][$ownerID] = 'owner_id';
                                }
                                else
                                {
                                    eZDebug::writeWarning( 'Could not fetch owner ( eZContentObject ): ' . $ownerID, __METHOD__ );
                                }
                            }
                            $facetArray[] = $fieldInfo;
                        } break;

                        // translation facet field
                        case eZSolr::getMetaFieldName( 'language_code' ):
                        {
                            $fieldInfo = array( 'field' => 'translation',
                                                'count' => count( $facetField ),
                                                'nameList' => array(),
                                                'queryLimit' => array(),
                                                'fieldList' => array(),
                                                'countList' => array() );
                            foreach ( $facetField as $languageCode => $count )
                            {
                                $fieldInfo['nameList'][$languageCode] = $languageCode;
                                $fieldInfo['queryLimit'][$languageCode] = 'language_code:' . $languageCode;
                                $fieldInfo['fieldList'][$languageCode] = 'language_code';
                                $fieldInfo['countList'][$languageCode] = $count;
                            }
                            $facetArray[] = $fieldInfo;
                        } break;

                        default:
                        {
                            $fieldInfo = array( 'field' => $field,
                                                'count' => count( $facetField ),
                                                'queryLimit' => array(),
                                                'fieldList' => array(),
                                                'nameList' => array(),
                                                'countList' => array() );
                            foreach ( $facetField as $value => $count )
                            {
                                $fieldInfo['nameList'][$value] = $value;
                                $fieldInfo['fieldList'][$value] = $field;
                                $fieldInfo['queryLimit'][$value] = $field . ':' . $value;
                                $fieldInfo['countList'][$value] = $count;
                            }
                            $facetArray[] = $fieldInfo;
                        } break;
                    }
                }

                $this->FacetFields = $facetArray;
                return $this->FacetFields;
            } break;

            case 'engine':
            {
                return eZSolr::engineText();
            } break;


            //may or may not be active, so returns false if not present
            case 'spellcheck':
            {
                if ( isset( $this->ResultArray['spellcheck'] ) && $this->ResultArray['spellcheck']['suggestions'] > 0 )
                {
                    return $this->ResultArray['spellcheck']['suggestions'];
                }
                else
                {
                    return false;
                }
            } break;

            case 'spellcheck_collation':
            {
                if ( isset( $this->ResultArray['spellcheck']['suggestions']['collation'] ) )
                {
                    // work around border case if 'collation' is searched for but does not exist in the spell check index
                    // the collation string is the last element of the suggestions array
                    return end( $this->ResultArray['spellcheck']['suggestions'] );

                }
                else
                {
                    return false;
                }
            } break;

            //only relevant for MoreLikeThis queries
            case 'interestingTerms':
            {
                if ( isset( $this->ResultArray['interestingTerms'] ) )
                {
                    return $this->ResultArray['interestingTerms'];
                }
                else
                {
                    return false;
                }
            } break;
            case 'facet_dates':
            {
                if ( isset( $this->ResultArray['facet_dates'] ) )
                {
                    return $this->ResultArray['facet_dates'];
                }
                else
                {
                    return false;
                }
            } break;

            case 'facet_ranges':
            {
                if ( isset( $this->ResultArray['facet_counts']['facet_ranges'] ) )
                {
                    return $this->ResultArray['facet_counts']['facet_ranges'];
                }
                else
                {
                    return false;
                }
            } break;
            case 'clusters':
            {
                if ( isset( $this->ResultArray['clusters'] ) )
                {
                    return $this->ResultArray['clusters'];
                }
                else
                {
                    return false;
                }
            } break;
            case 'highlighting':
            {
                if ( isset( $this->ResultArray['highlighting'] ) )
                {
                    return $this->ResultArray['highlighting'];
                }
                else
                {
                    return false;
                }
            } break;

            default:
            {
            } break;
        }
        return null;
    }
1258356
private function parse_attribs($attribs)
	{
		$ret     = array('default' => null);
		$attribs = trim($attribs);

		if($attribs == '')
			return $ret;

		// if this tag only has one = then there is only one attribute
		// so add it all to default
		if($attribs[0] == '=' && strrpos($attribs, '=') === 0)
			$ret['default'] = htmlentities(substr($attribs, 1), ENT_QUOTES | ENT_IGNORE, "UTF-8");
		else
		{
			preg_match_all('/(\S+)=((?:(?:(["\'])(?:\\\3|[^\3])*?\3))|(?:[^\'"\s]+))/',
				$attribs,
				$matches,
				PREG_SET_ORDER);

			foreach($matches as $match)
				$ret[$match[1]] = htmlentities($match[2], ENT_QUOTES | ENT_IGNORE, "UTF-8");
		}

		return $ret;
	}
221620
protected function attributes(array $attributes): string
	{
		$attr = '';

		foreach($attributes as $attribute => $value)
		{
			if(is_int($attribute))
			{
				$attribute = $value;
			}

			$attr .= ' ' . $attribute . '="' . $value . '"';
		}

		return $attr;
	}
1228675
protected function escapeAttr($attr)
    {
        $attr = (string) $attr;

        if (0 === strlen($attr)) {
            return '';
        }

        // Don't bother if there are no specialchars - saves some processing
        if (! preg_match('/[&<>"\']/', $attr)) {
            return $attr;
        }

        return htmlspecialchars($attr, ENT_COMPAT);
    }
1250036
public function obtenerAtributosObjetos($atributo){
        $base = $this->cfgDominio['base'][$this->objeto];
        $filtro = "(objectClass=$this->objeto)";
        $datos = $this->busqueda($base, $filtro, array($atributo), 0);
        $atributos = array();
        foreach ($datos as $attr) {
            $atributos[] = $attr[$atributo];
        }
        return $atributos;
    }
1061939
public function getAttribute($attr)
    {
        switch($attr)
        {
        case \PDO::ATTR_AUTOCOMMIT:
            return $this->_autocommit;
        case \PDO::ATTR_DRIVER_NAME:
            return 'oci';
        case \PDO::ATTR_CASE:
            return $this->_case;
        }
        return null;
    }
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;
    }