PHP Class Ouzo\Utilities\Objects

Afficher le fichier Open project: letsdrink/ouzo Class Usage Examples

Méthodes publiques

Méthode Description
booleanToString ( boolean $var ) : string Convert boolean to string 'true' or 'false'.
callMethod ( mixed $object, string $methodName, mixed $default ) : mixed
getValue ( mixed $object, string $field, null | mixed $default = null, boolean $accessPrivate = false ) : mixed | null
getValueOrCallMethod ( mixed $object, string $field, mixed $default, boolean $accessPrivate = false ) : mixed | null
getValueRecursively ( mixed $object, string $names, null | mixed $default = null, boolean $accessPrivate = false ) : mixed | null
setValueRecursively ( mixed $object, string $names, mixed $value )
toString ( mixed $var ) : string Returns a string representation of the given object.

Private Methods

Méthode Description
arrayToString ( array $array )
objectToString ( $object )
stringifyArrayElements ( $array )

Method Details

booleanToString() public static méthode

Convert boolean to string 'true' or 'false'.
public static booleanToString ( boolean $var ) : string
$var boolean
Résultat string

callMethod() public static méthode

public static callMethod ( mixed $object, string $methodName, mixed $default ) : mixed
$object mixed
$methodName string
$default mixed
Résultat mixed

getValue() public static méthode

public static getValue ( mixed $object, string $field, null | mixed $default = null, boolean $accessPrivate = false ) : mixed | null
$object mixed
$field string
$default null | mixed
$accessPrivate boolean
Résultat mixed | null

getValueOrCallMethod() public static méthode

public static getValueOrCallMethod ( mixed $object, string $field, mixed $default, boolean $accessPrivate = false ) : mixed | null
$object mixed
$field string
$default mixed
$accessPrivate boolean
Résultat mixed | null

getValueRecursively() public static méthode

public static getValueRecursively ( mixed $object, string $names, null | mixed $default = null, boolean $accessPrivate = false ) : mixed | null
$object mixed
$names string
$default null | mixed
$accessPrivate boolean
Résultat mixed | null

setValueRecursively() public static méthode

public static setValueRecursively ( mixed $object, string $names, mixed $value )
$object mixed
$names string
$value mixed

toString() public static méthode

Returns a string representation of the given object.
public static toString ( mixed $var ) : string
$var mixed
Résultat string