|
zObjectA zObject is basicaly an associative array (map) with public accessors accepting keys in path format, that is, nested keys delimited by a slash. That makes it very easy to costruct and access tree-like structures. This is, in fact, happening all over the place in zoglair. zObject publishes quite a few static path handling funcs and other helpers. Although not all of them are needed by its accessors, they are included for the sake of completeness.
void __construct(array $INFO, boolean $singleton=FALSE) ⇧ It should be noted that system zoglair classes must be instantiated via its factory method zoglair::load_plugin() and not directly. The factory does a lot more than simply calling
void add_info(string $info, mixed $value, boolean $unique=TRUE) ⇧ Helper function which combines get_info() and set_info() to add (append) a value in a property of type array (vector).
See also get_info(), set_info(), inc_info(). string array2str(array $A, integer $level=0, integer $maxlen=0)static ⇧ Converts an array to a human readable *.ini-like string. This function is recursive, so it can handle nested keys for tree-like maps, such as a zObject's properties. The array is sorted (by key order) before processing.
string array2xml(array $A, integer $level=0)static ⇧ Converts an array to a human readable *.xml-like string. This function is recursive, so it can handle nested keys for tree-like maps, such as a zObject's properties.
See also xml2array(). mixed get_arg(mixed $ARGS, string $key, mixed $default='')static ⇧ Safeguard for accessing array keys. Use this instead of testing with isset() or the error suppress operator
mixed get_info(string $info, mixed $default=NULL) ⇧ A universal, high usage frequency, object accessor. Used for getting the value of any object property (existing or not). Remember that properties are stored in a tree map, so the info passed can be a path.
See also set_info(), add_info(), inc_info(). string get_xml(string $root=zDataBase::Z_TBL_NAME_ADDON) ⇧ Return the object's properties in XML format.
See also set_xml(). mixed inc_info(string $info, mixed $value=1) ⇧ Helper function which combines get_info() and set_info() to increment a property's value. Useful for counters, run totals, etc.
See also get_info(), set_info(), add_info(). void Instance(array $INFO)static ⇧ A smart, polymorphic, method that gives the singleton capability to any derivative class. So, the class tree is kept plain and easy! No need to call it explicitly: zoglair::load_plugin() calls it on a need-to-use basis.
string path_base_dir(string $path, string $default='')static ⇧ Extracts the base dir (if exists) from a path. For example,
string path_base_dir_cut(string $path)static ⇧ Cuts the base dir (if exists) from a path. For example,
string path_change_ext(string $path, string $ext)static ⇧ Changes the file extension of a path, existing or not. For example,
string path_change_name(string $path, string $name)static ⇧ Changes the file name of a path, existing or not. For example,
string path_end_slash_cut(string $path)static ⇧ Cuts the trailing slash (if exists) from a path. For example,
string path_ext(string $path, string $default='')static ⇧ Extracts the file extension (if exists) from a path, without the dot. For example,
string path_ext_cut(string $path)static ⇧ Cuts the file extension (if exists) from a path, including the dot. For example,
void set_info(string $info, mixed $value) ⇧ A universal, high usage frequency, object mutator. Used for setting the value of any object property (existing or not). Remember that properties are stored in a tree map, so the info passed can be a path.
See also get_info(), add_info(), inc_info(). void set_xml(string $xml) ⇧ Recreates object's properties according to the $xml contents. This must have been previously generated by get_xml().
See also get_xml(). array xml2array(string $xml)static ⇧ Converts an *.xml-like string to an array (map). This is the reverse of array2xml() and basically used in set_xml() for unserializing an object that has been previously serialized by get_xml().
See also array2xml().
« Base Classes
zoglair »
|