ZMBeanUtils
public class ZMBeanUtils
| Method Summary | |
|---|---|
| static mixed | getBean(string definition) Build an object based on the bean definition. |
| protected array | getPropertyMap(mixed obj, array properties) Get the property mapping for a given class/object. |
| static mixed | map2obj(string clazz, array data, array keys) Create a new instance of the given class and populate with the provided data. |
| static array | obj2map(mixed obj, array properties, mixed addGeneric, addGeneric Optional) Convert an object into a map. |
| static void | setAll(mixed obj, array data, array keys, mixed setGeneric, setGeneric Optional) Set a given map of key/value pairs on an object. |
public static mixed getBean(string definition)
Build an object based on the bean definition.
The syntax for bean definitions is: [class name]#[property1=value1&property2=value2&...].
null.protected array getPropertyMap(mixed obj, array properties)
Get the property mapping for a given class/object.
If explicitely set (via $properties), generic properties will be considered too.
null for all.public static mixed map2obj(string clazz, array data, array keys)
Create a new instance of the given class and populate with the provided data.
null to use all.null.public static array obj2map(mixed obj, array properties, mixed addGeneric, addGeneric Optional)
Convert an object into a map.
If explicitely set (via $properties), generic properties will be considered, even if
$addGeneric is set to false.
null for all.ZMObject properties should be
* included or not; default is true to include generic properties.public static void setAll(mixed obj, array data, array keys, mixed setGeneric, setGeneric Optional)
Set a given map of key/value pairs on an object.
null to use all.ZMObject properties should be
* included or not; default is true to include generic properties.
Bean/model utilities.