-
Notifications
You must be signed in to change notification settings - Fork 35
icms_ipf_Tree
Raimondas Rimkevičius edited this page Mar 9, 2020
·
1 revision
Notice: Wiki was automatic generated from project sources as project API documentation. Do not edit manually!
A tree structures with objects as nodes
- Class name: icms_ipf_Tree
- Namespace:
private string $_parentId
Field name of parent object ID
- Visibility: private
public string $_myId
Field name of object ID
- Visibility: public
private string $_rootId = \null
Field name of root object ID
- Visibility: private
public array $_tree = array()
Array of Tree
- Visibility: public
private \icms_core_Object[] $_objects = array()
Array of objects
- Visibility: private
mixed icms_ipf_Tree::__construct(\icms_core_Object objectArr, string myId, string parentId, string rootId)
Constructor
- Visibility: public
- objectArr icms_core_Object - <p>Array of objects</p>
- myId string - <p>field name of object ID</p>
- parentId string - <p>field name of parent object ID</p>
- rootId string - <p>field name of root object ID</p>
mixed icms_ipf_Tree::_initialize()
Initialize the object
- Visibility: private
array icms_ipf_Tree::getTree()
Get the tree
- Visibility: public
object icms_ipf_Tree::getByKey(string key)
returns an object from the tree specified by its id
- Visibility: public
- key string - <p>ID of the object to retrieve</p>
array icms_ipf_Tree::getFirstChild(string key)
returns an array of all the first child object of an object specified by its id
- Visibility: public
- key string - <p>ID of the parent object</p>
array icms_ipf_Tree::getAllChild(string key, array ret)
returns an array of all child objects of an object specified by its id
- Visibility: public
- key string - <p>ID of the parent</p>
- ret array - <p>(Empty when called from client) Array of children from previous recursions.</p>
array icms_ipf_Tree::getAllParent(string key, array ret, int uplevel)
returns an array of all parent objects.
the key of returned array represents how many levels up from the specified object
- Visibility: public
- key string - <p>ID of the child object</p>
- ret array - <p>(empty when called from outside) Result from previous recursions</p>
- uplevel int - <p>(empty when called from outside) level of recursion</p>
mixed icms_ipf_Tree::_makeSelBoxOptions(string fieldName, string selected, int key, string ret, string prefix_orig, string prefix_curr)
Make options for a select box from
- Visibility: private
- fieldName string - <p>Name of the member variable from the node objects that should be used as the title for the options.</p>
- selected string - <p>Value to display as selected</p>
- key int - <p>ID of the object to display as the root of select options</p>
- ret string - <p>(reference to a string when called from outside) Result from previous recursions</p>
- prefix_orig string - <p>String to indent items at deeper levels</p>
- prefix_curr string - <p>String to indent the current item</p>
string icms_ipf_Tree::makeSelBox(string name, string fieldName, string prefix, string selected, bool addEmptyOption, int key)
Make a select box with options from the tree
- Visibility: public
- name string - <p>Name of the select box</p>
- fieldName string - <p>Name of the member variable from the node objects that should be used as the title for the options.</p>
- prefix string - <p>String to indent deeper levels</p>
- selected string - <p>Value to display as selected</p>
- addEmptyOption bool - <p>Set TRUE to add an empty option with value "0" at the top of the hierarchy</p>
- key int - <p>ID of the object to display as the root of select options</p>