\Utils

Summary

Methods
Properties
Constants
getValue()
getDisputeByTitle()
getOrganisations()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

getValue()

getValue(Array  $array, String  $key, String  $default = NULL) : Object

Gets the value of the given key from the given array, defaulting to the given default value if no value exists. If no default is provided and no value exists, an exception is raised.

Example: $arr = array('foo' => 'bar'); $val = getValue($arr, 'foo'); // $val === 'bar' $val = getValue($arr, 'abc', 'def'); // $val === 'def' $val = getValue($arr, 'abc'); // Exception raised

Parameters

Array $array

The array to search in.

String $key

The key whose value we want to find.

String $default

(Optional) - the default value if no value is found.

Returns

Object —

Returns the found value, the default value, or raises an exception.

getDisputeByTitle()

getDisputeByTitle(String  $title) : \Dispute

Semi-temporary function - used for DisputeStateTest.php. Maybe rethink the use of this function later down the line.

This function should NOT be called from within the application itself!

Parameters

String $title

The title of the dispute.

Returns

\Dispute

getOrganisations()

getOrganisations(Array  $params) : \Array<Organisation>

Gets organisations as an array.

Parameters

Array $params

Parameters: String $params['type'] Organisation type ('law_firm' / 'mediation_centre') Int $params['except'] Integer ID of an account to remove from the results.

Returns

\Array

An array of matching organisations of the correct subclass type (LawFirm or MediationCentre)