Class MachII_util_BeanUtil

Description

A utility class for working with bean components.

Beans are expected to follow the standard Java bean pattern of having a no argument constuctor and setter functions with name setXyz() (with a single argument named xyz) for field xyz and getters functions with name getXyz() (that accept no arguments).

Located in /MachII/util/BeanUtil.php (line 18)


	
			
Method Summary
mixed &createBean (string $beanType, [array $beanArgs = array()])
array describeBean (mixed $bean)
mixed getBeanField (mixed $bean, string $field)
void setBeanField (mixed &$bean, string $field, mixed &$value)
void setBeanFields (mixed &$bean, string $fields, array &$fieldCollection)
Methods
createBean (line 27)

Creates a bean.

mixed &createBean (string $beanType, [array $beanArgs = array()])
  • string $beanType: a fully qualified path to the bean class.
  • array $beanArgs: an associative array of arguments to pass to the constructor.
describeBean (line 88)

Returns an associative array of bean properties/values based on public getters.

Note: The Mach-II for PHP4/5's describeBean() is unable to determine private vs public unless a naming "trick" is used: getValue() is public, _getValue() is private. Also, it cannot determine if a getter accepts arguments. For these features use PHP5 and MachII5.

array describeBean (mixed $bean)
  • mixed $bean: the bean.
getBeanField (line 70)

Returns the value of a field.

mixed getBeanField (mixed $bean, string $field)
  • mixed $bean: the bean.
  • string $field: a fieldname.
setBeanField (line 58)

Sets the value of a field in a bean.

void setBeanField (mixed &$bean, string $field, mixed &$value)
  • mixed &$bean
  • string $field
  • mixed &$value
setBeanFields (line 42)

Sets the values of fields in a bean.

void setBeanFields (mixed &$bean, string $fields, array &$fieldCollection)
  • mixed &$bean: the bean to populate.
  • string $fields: a comma delimited list of field names.
  • array &$fieldCollection: an associative array of field values.

Documentation generated on Thu, 20 Jan 2005 10:46:52 -0800 by phpDocumentor 1.3.0RC3