\Fuman_Util_Object

Summary

Methods
Properties
Constants
toObject()
extract()
getValueForConstantName()
merge()
getValueOrDefault()
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

toObject()

toObject(array  $array, boolean  $recursive = false) : \stdClass

Converts an array recursively to an object

Parameters

array $array
boolean $recursive

Returns

\stdClass

extract()

extract(object  $object, array  $keys, boolean|integer  $mode, string  $prefix = '') : \stdClass

Create a new object with the passed keys.

Parameters

object $object
array $keys
boolean|integer $mode

0|false: fails if key not exists, 1: do nothing, 2|true: add null value

string $prefix

Returns

\stdClass

getValueForConstantName()

getValueForConstantName(string  $constantName) : mixed

Gets value for a given PHP constant

Parameters

string $constantName

Returns

mixed —

@ishacky

merge()

merge() : \stdClass

not-recursive-opject-merge

Returns

\stdClass

getValueOrDefault()

getValueOrDefault(\stdClass  $object, string  $key, mixed  $defaultValue) : mixed

Gets value or default from object

Parameters

\stdClass $object
string $key
mixed $defaultValue

Returns

mixed