Special setter for element's attribute.

@param  string path
@param  array query
@return self
344148
public function href($path, $query = NULL)
	{
		if ($query) {
			$query = http_build_query($query, '', '&');
			if ($query !== '') {
				$path .= '?' . $query;
			}
		}
		$this->attrs['href'] = $path;

		return $this;
	}
462426
private static function processReindexPath($path)
    {
        if (is_string($path) || is_integer($path)) {
            // Single level path - one element only
            $path = array(array($path));
        } elseif (is_array($path) && !empty($path) && !is_array($path[0])) {
            // Single level path - multiple elements
            // Check each path element is either a string or an integer
            foreach ($path as $key) {
                if (!(is_string($key) || is_integer($key))) {
                    throw new InvalidArgumentException('Invalid reindex path.');
                }
            }

            $path = array($path);
        } elseif (is_array($path) && !empty($path) && is_array($path[0])) {
            // Multilevel path
            // Check each path element is an array (a sub-path)
            foreach ($path as $subpath) {
                if (!is_array($subpath) || empty($subpath)) {
                    throw new InvalidArgumentException('Invalid reindex path.');
                }

                // Check each sub-path element is a valid array key (either a string or an integer)
                foreach ($subpath as $key) {
                    if (!(is_string($key) || is_integer($key))) {
                        throw new InvalidArgumentException('Invalid reindex path.');
                    }
                }
            }
        } else {
            throw new InvalidArgumentException('Invalid reindex path.');
        }

        return $path;
    }
173199
public function setPath($path)
    {
        if ($this->path) {
            $this->old_paths[] = $this->path;
        }
        $this->path = $path;

        return $this;
    }
811520
public function setQuery($query)
	{
		if (is_array($query))
		{
			$this->vars = $query;
		}
		else
		{
			if (strpos($query, '&amp;') !== false)
			{
				$query = str_replace('&amp;', '&', $query);
			}

			parse_str($query, $this->vars);
		}

		$this->query = null;

		return $this;
	}
667794
public void setPath( String path )
    {
        // Note that an empty path is OK
        if ( path == null )
        {
            _path = null;
            setQuery( null );
            setFragment( null );
        }
        else
        {
            _path = path;
            _opaque = false;
            setSchemeSpecificPart( null );
        }
    }
69192
public function withPath($path = __DIR__)
    {
        $before = get_declared_classes();

        $iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($path));
        foreach ($iterator as $item) {
            if (!$item->isDir() && substr($item->getPathname(), -4) == '.php') {
                require_once $item->getPathname();
            }
        }

        $after    = get_declared_classes();
        $commands = array_diff($after, $before);

        $this->withCommands($commands);

        return $this;
    }
997119
public function setPath(Path $path = null)
    {
        if (!empty($this->path)) {
            $this->path->removeStep($this);
        }

        $this->path = $path;

        if (!empty($path)) {
            $path->addStep($this);
        }

        return $this;
    }
1304723
public void setQuery( String query )
    {
        _parameters = null;

        if ( query == null || query.length() == 0 ) { return; }

        for ( StringTokenizer tok = new StringTokenizer( query, "&" ); tok.hasMoreElements(); )
        {
            String queryItem = tok.nextToken();

            if ( queryItem.startsWith( "amp;" ) )
            {
                queryItem = queryItem.substring( 4 );
            }

            int eq = queryItem.indexOf( '=' );
            if ( eq != -1 )
            {
                addParameter( queryItem.substring( 0, eq ) , queryItem.substring( eq + 1 ), true );
            }
            else
            {
                addParameter( queryItem, null, true );
            }
        }
    }
1304064
function setAttribute($id, $value, $disposition = self::ATTR_ALL)
    {
        $attributes = &$this->_subArray($this->currentCert, 'certificationRequestInfo/attributes', true);

        if (!is_array($attributes)) {
            return false;
        }

        switch ($disposition) {
            case self::ATTR_REPLACE:
                $disposition = self::ATTR_APPEND;
            case self::ATTR_ALL:
                $this->removeAttribute($id);
                break;
        }

        foreach ($attributes as $key => $attribute) {
            if ($attribute['type'] == $id) {
                $n = count($attribute['value']);
                switch (true) {
                    case $disposition == self::ATTR_APPEND:
                        $last = $key;
                        break;
                    case $disposition >= $n:
                        $disposition -= $n;
                        break;
                    default:
                        $attributes[$key]['value'][$disposition] = $value;
                        return true;
                }
            }
        }

        switch (true) {
            case $disposition >= 0:
                return false;
            case isset($last):
                $attributes[$last]['value'][] = $value;
                break;
            default:
                $attributes[] = array('type' => $id, 'value' => $disposition == self::ATTR_ALL ? $value: array($value));
                break;
        }

        return true;
    }
927175
public function setClientCertificatePath(array $path = null)
    {
        ValidationUtility::ensureNullOrArrayOfString('$path', $path);

        $this->clientCertificatePath = $path;

        return $this;
    }
1087334
public function setPath($path)
    {
        if (is_array($path)) {
            $this->path = '/' . implode('/', $path);
        } else {
            $this->path = (string) $path;
        }

        return $this;
    }
1150406
public T ignore(String path) {
        if (messageType.equalsIgnoreCase(MessageType.XML.name())
                || messageType.equalsIgnoreCase(MessageType.XHTML.name())) {
            xmlMessageValidationContext.getIgnoreExpressions().add(path);
        } else if (messageType.equalsIgnoreCase(MessageType.JSON.name())) {
            jsonMessageValidationContext.getIgnoreExpressions().add(path);
        }
        return self;
    }
297148
protected function replaceNamedParameters($path, array $query = array())
    {
        $grammar = $this;

        // Here we replace all named parameters in the path with values
        // from the query. Every value replaced will be bound to the
        // $replacedWheres variable of this class.
        return preg_replace_callback('/\{(.*?)\??\}/', function ($m) use ($grammar, $query) {
            $namedParameter = $m[1];

            $parameter = array_first($query, function ($key, $value) use ($namedParameter) {
                return $value['column'] == $namedParameter;
            });

            $hasParameter = ! is_null($parameter);

            // When the named parameter is found we add it to the replaced wheres
            // and replace it in the path.
            if ($hasParameter) {
                $grammar->addReplacedParameter($parameter);

                return $parameter['value'];
            }

            // We stop here when a named parameter is not provided.
            // Named parameters are most likely required and continuing
            // would result in unexpected results.
            throw new \InvalidArgumentException("Named parameter [$namedParameter] missing from request");
        }, $path);
    }
499763
public function set($path)
	{
		if (! is_string($path)) {
			throw new \InvalidArgumentException();
		}
		if ($path === '') {
			$this->setParts([]);
		} else {
			$this->setParts(explode('/', $path));
		}
		return $this;
	}
501780
public function setPath($path)
    {
        if(empty($path)) {
            $this->_path = '/';
        } else {
            $this->_path = $path;
        }

        return $this;
    }
1260595
public function setQueryString(array $query): self
    {

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

        $this->query_string = array_merge($this->query_string, $query);

        return $this;
    }
1131603
public static function setClassIndexMap($path)
    {
        if (is_array($path)) {
            self::$resultClassIndexMap = $path;
        } elseif (file_exists($path) && is_readable($path)) {
            self::$resultClassIndexMap = require_once($path);
        } else {
            throw new RuntimeException("Path $path does not exists or is not readable.");
        }
    }