Open Journal Systems  3.3.0
Guzzle\Http\QueryString Class Reference
Inheritance diagram for Guzzle\Http\QueryString:
Guzzle\Common\Collection Guzzle\Common\ToArrayInterface

Public Member Functions

 __toString ()
 
 encodeValue ($value)
 
 getFieldSeparator ()
 
 getUrlEncoding ()
 
 getValueSeparator ()
 
 isUrlEncoding ()
 
 setAggregator (QueryAggregatorInterface $aggregator=null)
 
 setFieldSeparator ($separator)
 
 setValueSeparator ($separator)
 
 urlEncode ()
 
 useUrlEncoding ($encode)
 
- Public Member Functions inherited from Guzzle\Common\Collection
 __construct (array $data=array())
 
 add ($key, $value)
 
 clear ()
 
 count ()
 
 filter (\Closure $closure, $static=true)
 
 get ($key)
 
 getAll (array $keys=null)
 
 getIterator ()
 
 getKeys ()
 
 getPath ($path, $separator='/', $data=null)
 
 hasKey ($key)
 
 hasValue ($value)
 
 inject ($input)
 
 keySearch ($key)
 
 map (\Closure $closure, array $context=array(), $static=true)
 
 merge ($data)
 
 offsetExists ($offset)
 
 offsetGet ($offset)
 
 offsetSet ($offset, $value)
 
 offsetUnset ($offset)
 
 overwriteWith ($data)
 
 remove ($key)
 
 replace (array $data)
 
 set ($key, $value)
 
 setPath ($path, $value)
 
 toArray ()
 

Static Public Member Functions

static fromString ($query)
 
- Static Public Member Functions inherited from Guzzle\Common\Collection
static fromConfig (array $config=array(), array $defaults=array(), array $required=array())
 

Data Fields

const BLANK = "_guzzle_blank_"
 
const FORM_URLENCODED = 'application/x-www-form-urlencoded'
 
const RFC_3986 = 'RFC 3986'
 

Protected Member Functions

 prepareData (array $data)
 

Protected Attributes

 $aggregator
 
 $fieldSeparator = '&'
 
 $urlEncode = 'RFC 3986'
 
 $valueSeparator = '='
 
- Protected Attributes inherited from Guzzle\Common\Collection
 $data
 

Detailed Description

Query string object to handle managing query string parameters and aggregating those parameters together as a string.

Definition at line 14 of file QueryString.php.

Member Function Documentation

◆ __toString()

Guzzle\Http\QueryString::__toString ( )

Convert the query string parameters to a query string string

Returns
string
Exceptions
RuntimeException

Definition at line 105 of file QueryString.php.

References Guzzle\Http\QueryString\prepareData().

◆ encodeValue()

Guzzle\Http\QueryString::encodeValue (   $value)

URL encodes a value based on the url encoding type of the query string object

Parameters
string$valueValue to encode
Returns
string

Definition at line 246 of file QueryString.php.

References Guzzle\Http\QueryString\urlEncode().

Referenced by Guzzle\Http\QueryAggregator\CommaAggregator\aggregate(), Guzzle\Http\QueryAggregator\PhpAggregator\aggregate(), Guzzle\Http\QueryAggregator\DuplicateAggregator\aggregate(), and Guzzle\Http\QueryString\prepareData().

◆ fromString()

◆ getFieldSeparator()

Guzzle\Http\QueryString::getFieldSeparator ( )

Get the query string field separator

Returns
string

Definition at line 124 of file QueryString.php.

References Guzzle\Http\QueryString\$fieldSeparator.

◆ getUrlEncoding()

Guzzle\Http\QueryString::getUrlEncoding ( )

Returns the type of URL encoding used by the query string

One of: false, "RFC 3986", or "application/x-www-form-urlencoded"

Returns
bool|string

Definition at line 146 of file QueryString.php.

References Guzzle\Http\QueryString\$urlEncode.

◆ getValueSeparator()

Guzzle\Http\QueryString::getValueSeparator ( )

Get the query string value separator

Returns
string

Definition at line 134 of file QueryString.php.

References Guzzle\Http\QueryString\$valueSeparator.

◆ isUrlEncoding()

Guzzle\Http\QueryString::isUrlEncoding ( )

Returns true or false if using URL encoding

Returns
bool

Definition at line 156 of file QueryString.php.

References Guzzle\Http\QueryString\urlEncode().

Referenced by Guzzle\Http\QueryAggregator\CommaAggregator\aggregate(), and Guzzle\Http\QueryAggregator\DuplicateAggregator\aggregate().

◆ prepareData()

Guzzle\Http\QueryString::prepareData ( array  $data)
protected

Url encode parameter data and convert nested query strings into a flattened hash.

Parameters
array$dataThe data to encode
Returns
array Returns an array of encoded values and keys

Definition at line 264 of file QueryString.php.

References Guzzle\Common\Collection\$data, Guzzle\Http\QueryString\encodeValue(), and Guzzle\Http\QueryString\setAggregator().

Referenced by Guzzle\Http\QueryString\__toString(), and Guzzle\Http\QueryString\urlEncode().

◆ setAggregator()

Guzzle\Http\QueryString::setAggregator ( QueryAggregatorInterface  $aggregator = null)

Provide a function for combining multi-valued query string parameters into a single or multiple fields

Parameters
null | QueryAggregatorInterface$aggregatorPass in a QueryAggregatorInterface object to handle converting deeply nested query string variables into a flattened array. Pass null to use the default PHP style aggregator. For legacy reasons, this function accepts a callable that must accepts a $key, $value, and query object.
Returns
self
See also
\Guzzle\Http\QueryString::aggregateUsingComma()

Definition at line 172 of file QueryString.php.

References Guzzle\Http\QueryString\$aggregator.

Referenced by Guzzle\Http\QueryString\prepareData().

◆ setFieldSeparator()

Guzzle\Http\QueryString::setFieldSeparator (   $separator)

Set the query string separator

Parameters
string$separatorThe query string separator that will separate fields
Returns
self

Definition at line 208 of file QueryString.php.

◆ setValueSeparator()

Guzzle\Http\QueryString::setValueSeparator (   $separator)

Set the query string value separator

Parameters
string$separatorThe query string separator that will separate values from fields
Returns
self

Definition at line 222 of file QueryString.php.

◆ urlEncode()

Guzzle\Http\QueryString::urlEncode ( )

Returns an array of url encoded field names and values

Returns
array

Definition at line 234 of file QueryString.php.

References Guzzle\Http\QueryString\prepareData().

Referenced by Guzzle\Http\QueryString\encodeValue(), Guzzle\Http\QueryString\isUrlEncoding(), and Guzzle\Http\QueryString\useUrlEncoding().

◆ useUrlEncoding()

Guzzle\Http\QueryString::useUrlEncoding (   $encode)

Set whether or not field names and values should be rawurlencoded

Parameters
bool | string$encodeSet to TRUE to use RFC 3986 encoding (rawurlencode), false to disable encoding, or form_urlencoding to use application/x-www-form-urlencoded encoding (urlencode)
Returns
self

Definition at line 194 of file QueryString.php.

References Guzzle\Http\QueryString\urlEncode().

Field Documentation

◆ $aggregator

QueryAggregatorInterface Guzzle\Http\QueryString::$aggregator
protected

Definition at line 47 of file QueryString.php.

Referenced by Guzzle\Http\QueryString\setAggregator().

◆ $fieldSeparator

string Guzzle\Http\QueryString::$fieldSeparator = '&'
protected

Definition at line 29 of file QueryString.php.

Referenced by Guzzle\Http\QueryString\getFieldSeparator().

◆ $urlEncode

bool Guzzle\Http\QueryString::$urlEncode = 'RFC 3986'
protected

URL encode fields and values

Definition at line 41 of file QueryString.php.

Referenced by Guzzle\Http\QueryString\getUrlEncoding().

◆ $valueSeparator

string Guzzle\Http\QueryString::$valueSeparator = '='
protected

The query string value separator (e.g. '=')

Definition at line 35 of file QueryString.php.

Referenced by Guzzle\Http\QueryString\getValueSeparator().

◆ BLANK

const Guzzle\Http\QueryString::BLANK = "_guzzle_blank_"

◆ FORM_URLENCODED

const Guzzle\Http\QueryString::FORM_URLENCODED = 'application/x-www-form-urlencoded'

Definition at line 21 of file QueryString.php.

Referenced by Guzzle\Tests\Http\QueryStringTest\testIsUrlEncoding().

◆ RFC_3986

const Guzzle\Http\QueryString::RFC_3986 = 'RFC 3986'

Used to URL encode with rawurlencode

Definition at line 18 of file QueryString.php.


The documentation for this class was generated from the following file: