Class LoggerReflectionUtils
Provides methods for reflective use on php objects
Methods summary
public
|
#
__construct( object $obj )
Create a new LoggerReflectionUtils for the specified Object. This is done in
prepartion for invoking LoggerReflectionUtils::setProperty() one or more times.
Parameters
- $obj
object &$obj the object for which to set properties
|
public static
|
|
public
|
#
setProperties( array $properties, string $prefix )
Set the properites for the object that match the prefix passed
as parameter.
Set the properites for the object that match the prefix passed
as parameter.
Example:
$arr['xxxname'] = 'Joe'; $arr['xxxmale'] = true; and prefix xxx causes
setName and setMale.
Parameters
- $properties
array $properties An array containing keys and values.
- $prefix
string $prefix Only keys having the specified prefix will be set.
|
public
|
#
setProperty( string $name, string $value )
Set a property on this PropertySetter's Object. If successful, this method
will invoke a setter method on the underlying Object. The setter is the one for
the specified property name and the value is determined partly from the setter
argument type and partly from the value specified in the call to this
method.
Set a property on this PropertySetter's Object. If successful, this method
will invoke a setter method on the underlying Object. The setter is the one for
the specified property name and the value is determined partly from the setter
argument type and partly from the value specified in the call to this
method.
If the setter expects a String no conversion is necessary. If it expects an
int, then an attempt is made to convert 'value' to an int using new
Integer(value). If the setter expects a boolean, the conversion is by new
Boolean(value).
Parameters
- $name
string $name name of the property
- $value
string $value String value of the property
|
public
|
|
public static
an
|
#
createObject( string $class )
Creates an instances from the given class name.
Creates an instances from the given class name.
Parameters
Returns
an object from the class with the given classname
|
public static
|
#
setter( object $object, string $name, mixed $value )
Parameters
- $object
object $object
- $name
string $name
- $value
mixed $value
|