Class LoggerReflectionUtils

Description

Provides methods for reflective use on php objects

Located in /LoggerReflectionUtils.php (line 25)


	
			
Method Summary
static an createObject ( $class, string $classname)
static void setPropertiesByObject (object $obj, array $properties, string $prefix)
static void setter (object $object, string $name, mixed $value)
LoggerReflectionUtils __construct ( $obj, object &$obj)
void activate ()
void setProperties (array $properties, string $prefix)
void setProperty (string $name, string $value)
Methods
static createObject (line 129)

Creates an instances from the given class name.

  • return: object from the class with the given classname
  • access: public
static an createObject ( $class, string $classname)
  • string $classname
  • $class
static setPropertiesByObject (line 50)

Set the properties of an object passed as a parameter in one go. The

  1. properties
are parsed relative to a
  1. prefix
.

  • access: public
static void setPropertiesByObject (object $obj, array $properties, string $prefix)
  • object $obj: The object to configure.
  • array $properties: An array containing keys and values.
  • string $prefix: Only keys having the specified prefix will be set.
static setter (line 142)
  • access: public
static void setter (object $object, string $name, mixed $value)
  • object $object
  • string $name
  • mixed $value
Constructor __construct (line 35)

Create a new LoggerReflectionUtils for the specified Object.

This is done in prepartion for invoking setProperty() one or more times.

  • access: public
LoggerReflectionUtils __construct ( $obj, object &$obj)
  • object &$obj: the object for which to set properties
  • $obj
activate (line 117)
  • access: public
void activate ()
setProperties (line 70)

Set the properites for the object that match the

  1. prefix
passed as parameter.

Example:

$arr['xxxname'] = 'Joe'; $arr['xxxmale'] = true; and prefix xxx causes setName and setMale.

  • access: public
void setProperties (array $properties, string $prefix)
  • array $properties: An array containing keys and values.
  • string $prefix: Only keys having the specified prefix will be set.
setProperty (line 103)

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.

<p>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).

  • access: public
void setProperty (string $name, string $value)
  • string $name: name of the property
  • string $value: String value of the property

Documentation generated on Fri, 27 Nov 2009 07:44:52 +0100 by phpDocumentor 1.4.3