Open Journal Systems  3.3.0
Guzzle\Common\Collection Class Reference
Inheritance diagram for Guzzle\Common\Collection:
Guzzle\Common\ToArrayInterface Guzzle\Http\QueryString Guzzle\Service\Command\AbstractCommand Guzzle\Service\Resource\Model Guzzle\Service\Command\ClosureCommand Guzzle\Service\Command\OperationCommand Guzzle\Tests\Service\Mock\Command\MockCommand Guzzle\Tests\Service\Mock\Command\IterableCommand Guzzle\Tests\Service\Mock\Command\OtherCommand Guzzle\Tests\Service\Mock\Command\Sub\Sub

Public Member Functions

 __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 fromConfig (array $config=array(), array $defaults=array(), array $required=array())
 

Protected Attributes

 $data
 

Detailed Description

Key value pair collection object

Definition at line 11 of file paymethod/paypal/lib/vendor/guzzle/guzzle/src/Guzzle/Common/Collection.php.

Constructor & Destructor Documentation

◆ __construct()

Guzzle\Common\Collection::__construct ( array  $data = array())
Parameters
array$dataAssociative array of data to set

Definition at line 22 of file paymethod/paypal/lib/vendor/guzzle/guzzle/src/Guzzle/Common/Collection.php.

References Guzzle\Common\Collection\$data.

Member Function Documentation

◆ add()

Guzzle\Common\Collection::add (   $key,
  $value 
)

Add a value to a key. If a key of the same name has already been added, the key value will be converted into an array and the new value will be pushed to the end of the array.

Parameters
string$keyKey to add
mixed$valueValue to add to the key
Returns
Collection Returns a reference to the object.

Definition at line 123 of file paymethod/paypal/lib/vendor/guzzle/guzzle/src/Guzzle/Common/Collection.php.

Referenced by Guzzle\Common\Collection\merge().

◆ clear()

Guzzle\Common\Collection::clear ( )

Removes all key value pairs

Returns
Collection

Definition at line 68 of file paymethod/paypal/lib/vendor/guzzle/guzzle/src/Guzzle/Common/Collection.php.

◆ count()

Guzzle\Common\Collection::count ( )

◆ filter()

Guzzle\Common\Collection::filter ( \Closure  $closure,
  $static = true 
)

Iterates over each key value pair in the collection passing them to the Closure. If the Closure function returns true, the current value from input is returned into the result Collection. The Closure must accept three parameters: (string) $key, (string) $value and return Boolean TRUE or FALSE for each value.

Parameters
\Closure$closureClosure evaluation function
bool$staticSet to TRUE to use the same class as the return rather than returning a Collection
Returns
Collection

Definition at line 285 of file paymethod/paypal/lib/vendor/guzzle/guzzle/src/Guzzle/Common/Collection.php.

◆ fromConfig()

static Guzzle\Common\Collection::fromConfig ( array  $config = array(),
array  $defaults = array(),
array  $required = array() 
)
static

Create a new collection from an array, validate the keys, and add default values where missing

Parameters
array$configConfiguration values to apply.
array$defaultsDefault parameters
array$requiredRequired parameter names
Returns
self
Exceptions
InvalidArgumentExceptionif a parameter is missing

Definition at line 37 of file paymethod/paypal/lib/vendor/guzzle/guzzle/src/Guzzle/Common/Collection.php.

References Guzzle\Common\Collection\$data.

Referenced by Guzzle\Plugin\Oauth\OauthPlugin\__construct(), Guzzle\Tests\Service\Mock\MockClient\factory(), and Guzzle\Tests\Common\CollectionTest\testPreparesFromConfig().

◆ get()

Guzzle\Common\Collection::get (   $key)

Get a specific key value.

Parameters
string$keyKey to retrieve.
Returns
mixed|null Value of the key or NULL

Definition at line 94 of file paymethod/paypal/lib/vendor/guzzle/guzzle/src/Guzzle/Common/Collection.php.

◆ getAll()

Guzzle\Common\Collection::getAll ( array  $keys = null)

Get all or a subset of matching key value pairs

Parameters
array$keysPass an array of keys to retrieve only a subset of key value pairs
Returns
array Returns an array of all matching key value pairs

Definition at line 82 of file paymethod/paypal/lib/vendor/guzzle/guzzle/src/Guzzle/Common/Collection.php.

References Guzzle\Common\Collection\$data.

◆ getIterator()

Guzzle\Common\Collection::getIterator ( )

◆ getKeys()

Guzzle\Common\Collection::getKeys ( )

Get all keys in the collection

Returns
array

Definition at line 155 of file paymethod/paypal/lib/vendor/guzzle/guzzle/src/Guzzle/Common/Collection.php.

◆ getPath()

Guzzle\Common\Collection::getPath (   $path,
  $separator = '/',
  $data = null 
)

Gets a value from the collection using an array path (e.g. foo/baz/bar would retrieve bar from two nested arrays) Allows for wildcard searches which recursively combine matches up to the level at which the wildcard occurs. This can be useful for accepting any key of a sub-array and combining matching keys from each diverging path.

Parameters
string$pathPath to traverse and retrieve a value from
string$separatorCharacter used to add depth to the search
mixed$dataOptional data to descend into (used when wildcards are encountered)
Returns
mixed|null

Definition at line 357 of file paymethod/paypal/lib/vendor/guzzle/guzzle/src/Guzzle/Common/Collection.php.

References Guzzle\Common\Collection\$data.

◆ hasKey()

Guzzle\Common\Collection::hasKey (   $key)

Returns whether or not the specified key is present.

Parameters
string$keyThe key for which to check the existence.
Returns
bool

Definition at line 167 of file paymethod/paypal/lib/vendor/guzzle/guzzle/src/Guzzle/Common/Collection.php.

◆ hasValue()

Guzzle\Common\Collection::hasValue (   $value)

Checks if any keys contains a certain value

Parameters
string$valueValue to search for
Returns
mixed Returns the key if the value was found FALSE if the value was not found.

Definition at line 197 of file paymethod/paypal/lib/vendor/guzzle/guzzle/src/Guzzle/Common/Collection.php.

◆ inject()

Guzzle\Common\Collection::inject (   $input)

Inject configuration settings into an input string

Parameters
string$inputInput to inject
Returns
string
Deprecated:

Definition at line 396 of file paymethod/paypal/lib/vendor/guzzle/guzzle/src/Guzzle/Common/Collection.php.

References Guzzle\Common\Version\warn().

◆ keySearch()

Guzzle\Common\Collection::keySearch (   $key)

Case insensitive search the keys in the collection

Parameters
string$keyKey to search for
Returns
bool|string Returns false if not found, otherwise returns the key

Definition at line 179 of file paymethod/paypal/lib/vendor/guzzle/guzzle/src/Guzzle/Common/Collection.php.

◆ map()

Guzzle\Common\Collection::map ( \Closure  $closure,
array  $context = array(),
  $static = true 
)

Returns a Collection containing all the elements of the collection after applying the callback function to each one. The Closure should accept three parameters: (string) $key, (string) $value, (array) $context and return a modified value

Parameters
\Closure$closureClosure to apply
array$contextContext to pass to the closure
bool$staticSet to TRUE to use the same class as the return rather than returning a Collection
Returns
Collection

Definition at line 265 of file paymethod/paypal/lib/vendor/guzzle/guzzle/src/Guzzle/Common/Collection.php.

Referenced by Guzzle\Tests\Service\Resource\ModelTest\testCanBeUsedWithoutStructure().

◆ merge()

Guzzle\Common\Collection::merge (   $data)

Add and merge in a Collection or array of key value pair data.

Parameters
Collection | array$dataAssociative array of key value pair data
Returns
Collection Returns a reference to the object.

Definition at line 223 of file paymethod/paypal/lib/vendor/guzzle/guzzle/src/Guzzle/Common/Collection.php.

References Guzzle\Common\Collection\$data, and Guzzle\Common\Collection\add().

◆ offsetExists()

Guzzle\Common\Collection::offsetExists (   $offset)

◆ offsetGet()

Guzzle\Common\Collection::offsetGet (   $offset)

◆ offsetSet()

Guzzle\Common\Collection::offsetSet (   $offset,
  $value 
)

◆ offsetUnset()

Guzzle\Common\Collection::offsetUnset (   $offset)

◆ overwriteWith()

Guzzle\Common\Collection::overwriteWith (   $data)

Over write key value pairs in this collection with all of the data from an array or collection.

Parameters
array | \Traversable$dataValues to override over this config
Returns
self

Definition at line 239 of file paymethod/paypal/lib/vendor/guzzle/guzzle/src/Guzzle/Common/Collection.php.

References Guzzle\Common\Collection\$data.

◆ remove()

Guzzle\Common\Collection::remove (   $key)

Remove a specific key value pair

Parameters
string$keyA key to remove
Returns
Collection

Definition at line 143 of file paymethod/paypal/lib/vendor/guzzle/guzzle/src/Guzzle/Common/Collection.php.

◆ replace()

Guzzle\Common\Collection::replace ( array  $data)

Replace the data of the object with the value of an array

Parameters
array$dataAssociative array of data
Returns
Collection Returns a reference to the object

Definition at line 209 of file paymethod/paypal/lib/vendor/guzzle/guzzle/src/Guzzle/Common/Collection.php.

References Guzzle\Common\Collection\$data.

◆ set()

Guzzle\Common\Collection::set (   $key,
  $value 
)

Set a key value pair

Parameters
string$keyKey to set
mixed$valueValue to set
Returns
Collection Returns a reference to the object

Definition at line 107 of file paymethod/paypal/lib/vendor/guzzle/guzzle/src/Guzzle/Common/Collection.php.

◆ setPath()

Guzzle\Common\Collection::setPath (   $path,
  $value 
)

Set a value into a nested array key. Keys will be created as needed to set the value.

Parameters
string$pathPath to set
mixed$valueValue to set at the key
Returns
self
Exceptions
RuntimeExceptionwhen trying to setPath using a nested path that travels through a scalar value

Definition at line 326 of file paymethod/paypal/lib/vendor/guzzle/guzzle/src/Guzzle/Common/Collection.php.

References Guzzle\Common\Collection\$data.

◆ toArray()

Guzzle\Common\Collection::toArray ( )

Field Documentation

◆ $data


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