ZMObject
└─ZMBeanUtils
public class ZMBeanUtils
extends ZMObject
| Fields inherited from org.zenmagick.core\ZMObject | |
|---|---|
| properties_ | |
| Method Summary | |
|---|---|
| static mixed | getBean(string definition, boolean ignoreContext) Build an object based on the bean definition. |
| static 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, bool addGeneric, addGeneric Optional) Convert an object into a map. |
| static mixed | setAll(mixed obj, array data, array keys, bool setGeneric, setGeneric Optional) Set a given map of key/value pairs on an object. |
| Methods inherited from org.zenmagick.core\ZMObject | |
|---|---|
| __construct, attachMethod, get, getAttachedMethods, getProperties, getPropertyNames, set, singleton | |
public static mixed getBean(string definition, boolean ignoreContext)
Build an object based on the bean definition.
The syntax for bean definitions is: [class name]#[property1=value1&property2=value2&...].
false.null.public static 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, bool 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 mixed setAll(mixed obj, array data, array keys, bool 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.$obj.
Bean utility.
Bean definitions and properties handled by this class may one of the following special (magic) name prefixes to create/set objects rather than strings:
null.ZMSettings::get()). The configured value (string) is then used to create the bean instance. This allows to use symbolic names and configure default implementations via settings.