Class DBMS_TREE_NODE

Description

Base class DBMS_TABLEOBJ to handel table data in an object

  • author: Peter Krebs (pk) <pitlinz@users.sourceforge.net>
  • version: pk-04-01-02
  • version: pk-05-11-17
  • version: pk-08-01-31
  • version: $Id: DBMS_TABLEOBJ.phpclass,v 1.60 2008/12/17 16:28:52 peterkrebs Exp $

Located in /db/DBMS_TREE_NODE.phpclass (line 41)

OCSP_OBJ
   |
   --DBMS_TABLEOBJ
      |
      --DBMS_TREE_NODE
Direct descendents
Class Description
 class CLIENT_DEP_TREE_NODE Base class DBMS_TABLEOBJ to handel table data in an object
 class CMS_MENU_NODE Class CMS_MENU_NODE
 class MED_CATEGORY_NODE media category tree node
 class PRO_GROUP_NODE Class PRO_GROUP_NODE
Variable Summary
Method Summary
 DBMS_TREE_NODE DBMS_TREE_NODE ([ $aId = 0], [ $myTree = ""], [ $auto_populate = TRUE], [ $debug = FALSE])
 string addChildNode ( &$aNode, [boolean $debug = FALSE], DBMS_TREE_NODE $aNode)
 void changeParent ([boolean $debug = FALSE])
 boolean changesParent ()
 void filterAdd (string $key, mixed $val, [boolean $debug = FALSE])
 void filterClear ()
 void filterRemoveKey (string $key, boolean $debug)
 DBMS_TREE_NODE &getChild (int $childId, [boolean $debug = FALSE])
 string getChildQueryString ([string $cols = "*"], [boolean $debug = FALSE])
 void getChildrenList ([ $useCache = True], [ $debug = False], [ $filtered = False])
 string getChildTblName ()
 string getGlobalTreeKey ([boolean $debug = FALSE])
 int getId ()
 int getLevel ()
 int getOrderNr ()
 mixed getParentId ([boolean $debug = FALSE])
 DBMS_TREE_NODE &getParentObj ([boolean $useCache = TRUE], [boolean $debug = FALSE])
 array getRootPath ([boolean $useCache = TRUE], [boolean $debug = FALSE])
 int getRootPathIdx ( &$rootPath, [boolean $debug = FALSE], array $rootPath)
 DBMS_TREE &getTree ([boolean $useCache = TRUE], [boolean $debug = FALSE], [boolean $checkParent = TRUE])
 boolean hasChildren ([boolean $debug = FALSE])
 boolean matchFilter ([boolean $debug = FALSE])
 boolean moveChildDown (int $childId, [boolean $debug = FALSE], [boolean $autosave = FALSE])
 boolean moveChildUp (int $childId, [boolean $debug = FALSE], [boolean $autosave = TRUE])
 DBMS_TREE_NODE newChildObj (array $dbRow, boolean $debug)
 DBMS_TREE &newTreeObj ([boolean $debug = False])
 int numberOfChildren ([boolean $useCache = TRUE], [boolean $debug = FALSE])
 double populateChildren ([boolean $useCache = True], [boolean $debug = False])
 void populateTree ([boolean $useCache = TRUE], [boolean $debug = FALSE])
 void resortChildren ([boolean $debug = FALSE], [boolean $autosave = TRUE])
 void setChildClassVar ( &$child, &DBMS_TREE_NODE $child)
 void setConfigurationArr (array $confArr, [boolean $debug = FALSE])
 void setId (int $aId)
 void setLevel (int $aLevel)
 void setLink (string $aLink)
 void setOrderNr (int $aOrderNr)
 void setParentId (int $aId)
 void setParentObj ( &$aParent, DBMS_TREE_NODE $aParent)
 void setTreeObj ( &$aTree, DBMS_TREE $aTree)
Variables
boolean $changesParent = FALSE (line 162)

the child object changes parent

if true changeParent() is called after populateChildren

  • since: pk-05-12-12
  • access: protected
int $level (line 133)
  • var: level in the tree 0=root 1=children of root ...
  • access: protected
mixed $myChildCacheTTL = 86400 (line 121)
  • staticvar: int $myChildCacheTTL:
  • access: protected
mixed $myChildClass = "DBMS_TREE_NODE" (line 103)
  • staticvar: string $myChildClass: NOT FINAL name of the class children should have it is used in eval("new ".$myChildClass."()")
  • access: protected

Redefined in descendants as:
mixed $myChildKeys = "" (line 109)
  • staticvar: strint $myChildKeys: NOT FINAL comma sperated list of keys the children have to fit to
  • access: protected

Redefined in descendants as:
array $myChildren = array() (line 115)

array starts at 1 !! key=sortorder

  • access: protected
double $myChildrenPopulateTS (line 127)

timestamp when the $this->myChildren has been populates

  • access: protected
mixed $myClassSrcFile = __FILE__ (line 47)
  • staticvar: string $myClassSrcFile: if is set the DBMS_FORM get the class object
  • since: pk-07-10-14
  • access: protected

Redefined in descendants as:
array $myFilterArr = NULL (line 152)
  • since: pk-05-01-06
  • access: protected
mixed $myIdFld = "" (line 80)
  • staticvar: string $myIdFld: NOT FINAL name column which is the parent column in childrows
  • access: protected

Redefined in descendants as:
string $myLink = "" (line 145)
  • var: link the entry
  • access: protected
DBMS_TREE_NODE $myParent = NULL (line 70)
  • since: pk-07-08-10
  • access: protected
mixed $myParentFld = "" (line 85)
  • staticvar: string $myParentFld: NOT FINAL name of the parent column
  • access: protected

Redefined in descendants as:
mixed $mySortFld = "" (line 90)
  • staticvar: string $mySortFld: NOT FINAL name of the sort field
  • access: protected

Redefined in descendants as:
DBMS_TREE $myTree = NULL (line 63)
  • since: pk-05-07-12
  • access: protected
mixed $myTreeClass = "DBMS_TREE" (line 96)
  • staticvar: string $myTreeClass:
  • since: pk-05-07-12
  • access: protected

Redefined in descendants as:
int $orderNr (line 139)
  • var: the child nr x of parent (SORTORDER !!) take care the childs are ordered proper when using this
  • access: protected

Inherited Variables

Inherited from DBMS_TABLEOBJ

DBMS_TABLEOBJ::$autoIncFld
DBMS_TABLEOBJ::$dbTableDefinitions
DBMS_TABLEOBJ::$frmPostSubOjects
DBMS_TABLEOBJ::$hasObjVals
DBMS_TABLEOBJ::$initTS
DBMS_TABLEOBJ::$myCacheTS
DBMS_TABLEOBJ::$myFields
DBMS_TABLEOBJ::$myKeys
DBMS_TABLEOBJ::$myLinkedTableRows
DBMS_TABLEOBJ::$myMode
DBMS_TABLEOBJ::$myObjVals
DBMS_TABLEOBJ::$myObjValsPopulateTS
DBMS_TABLEOBJ::$myTable
DBMS_TABLEOBJ::$objError
DBMS_TABLEOBJ::$objErrorMsg
DBMS_TABLEOBJ::$populateTS
DBMS_TABLEOBJ::$staticClassVars
DBMS_TABLEOBJ::$valChangeTS

Inherited from OCSP_OBJ

OCSP_OBJ::$global_currentUser
OCSP_OBJ::$global_defaultDBObj_read
OCSP_OBJ::$global_defaultDBObj_write
OCSP_OBJ::$myDBObj
Methods
Constructor DBMS_TREE_NODE (line 184)
DBMS_TREE_NODE DBMS_TREE_NODE ([ $aId = 0], [ $myTree = ""], [ $auto_populate = TRUE], [ $debug = FALSE])
  • $aId
  • $myTree
  • $auto_populate
  • $debug
addChildNode (line 1010)

adds a node to childArray($key)

string addChildNode ( &$aNode, [boolean $debug = FALSE], DBMS_TREE_NODE $aNode)

Redefined in descendants as:
changeParent (line 878)
  • abstract: changeParent
  • since: pk-05-12-13
void changeParent ([boolean $debug = FALSE])
  • boolean $debug
changesParent (line 343)
  • since: pk-05-12-13
boolean changesParent ()
childListIsPopulated (line 1217)
  • since: pk-07-09-17
  • access: public
boolean childListIsPopulated ()
filterAdd (line 652)

adds a key value pair to $myFilterArr

  • since: pk-05-01-06
void filterAdd (string $key, mixed $val, [boolean $debug = FALSE])
  • string $key
  • mixed $val
  • boolean $debug
filterClear (line 638)

clears the filter

  • since: pk-05-01-06
void filterClear ()
filterRemoveKey (line 672)

removes a key form the filter

  • since: pk-05-01-06
void filterRemoveKey (string $key, boolean $debug)
  • string $key
  • boolean $debug
getChild (line 820)
  • since: pk-07-08-23
DBMS_TREE_NODE &getChild (int $childId, [boolean $debug = FALSE])
  • int $childId
  • boolean $debug
getChildQueryString (line 845)

returns the select statement to get the children

  • since: pk-05-11-23
string getChildQueryString ([string $cols = "*"], [boolean $debug = FALSE])
  • string $cols: ("SELECT ".$cols." FORM ...")
  • boolean $debug

Redefined in descendants as:
getChildrenList (line 1281)
void getChildrenList ([ $useCache = True], [ $debug = False], [ $filtered = False])
  • $useCache
  • $debug
  • $filtered

Redefined in descendants as:
getChildTblName (line 248)
string getChildTblName ()

Redefined in descendants as:
getGlobalTreeKey (line 452)

returns the GlobalTreeKey

  • version: pk-06-07-26
  • version: pk-07-06-19
  • version: pk-07-08-15
string getGlobalTreeKey ([boolean $debug = FALSE])
  • boolean $debug
getId (line 260)

returns the id

int getId ()

Redefined in descendants as:
getLevel (line 280)

returns the Level

int getLevel ()
getOrderNr (line 300)

returns the orderNr

int getOrderNr ()
getParentId (line 533)

returns the parent id

  • version: pk-05-01-04 $debug added
  • version: pk-05-12-12 return value changed
  • version: pk-07-06-19
  • access: public
mixed getParentId ([boolean $debug = FALSE])
  • boolean $debug
getParentObj (line 575)

returns the parent object or null if parent is root

  • version: pk-06-07-26 bugfix
  • version: pk-07-06-19
  • version: pk-07-08-10 myParent added to class
  • since: pk-05-01-04
DBMS_TREE_NODE &getParentObj ([boolean $useCache = TRUE], [boolean $debug = FALSE])
  • boolean $useCache
  • boolean $debug

Redefined in descendants as:
getRootPath (line 477)

returns a array back to the root (same as DBMS_TREE->getRootPath) but the tree is not populated saves time and space

  • since: pk-05-07-25
array getRootPath ([boolean $useCache = TRUE], [boolean $debug = FALSE])
  • boolean $useCache
  • boolean $debug

Redefined in descendants as:
  • CMS_MENU_NODE::getRootPath() : returns a array back to the root if we have MEN_LINKTYPE 10 ($page->subMenu()) the page menu is included in the rootPath if $GLOBALS['CURRENT_PROJ']->curMen
getRootPathIdx (line 502)

returns the index of the node in the root path

returns -1 if node is not in $rootPath

  • since: pk-04-12-30
int getRootPathIdx ( &$rootPath, [boolean $debug = FALSE], array $rootPath)
  • array $rootPath
  • boolean $debug
  • &$rootPath
getTree (line 407)

returns myTree object

  • version: pk-07-08-09
  • version: pk-07-08-23 added $checkParent to avoid loops in DBMS_TREE_NODE::getParentObj()
  • since: pk-05-07-12
DBMS_TREE &getTree ([boolean $useCache = TRUE], [boolean $debug = FALSE], [boolean $checkParent = TRUE])
  • boolean $useCache
  • boolean $debug
  • boolean $checkParent: (if false $this->getParentObj is not called)

Redefined in descendants as:
hasChildren (line 1231)

returns if the node has children

  • access: public
boolean hasChildren ([boolean $debug = FALSE])
  • boolean $debug
matchFilter (line 693)

returns if the node matches the filter array NOTE checks only for exact match

  • since: pk-04-12-29
boolean matchFilter ([boolean $debug = FALSE])
  • boolean $debug
moveChildDown (line 1117)

moves a child down (increase sort field)

  • return: if the childs has changed
  • version: pk-07-08-24
boolean moveChildDown (int $childId, [boolean $debug = FALSE], [boolean $autosave = FALSE])
  • int $childId
  • boolean $debug
  • boolean $autosave: (save changes to the database)
moveChildUp (line 1162)

moves a child up (decrease sort field)

  • return: if the childs has changed
  • version: pk-07-08-24
boolean moveChildUp (int $childId, [boolean $debug = FALSE], [boolean $autosave = TRUE])
  • int $childId
  • boolean $debug
  • boolean $autosave: (save changes to the database)
newChildObj (line 781)

creates a child object out of database row

NOTE does not add the object to the tree only sets objects parent

  • return: (ptr)
  • version: pk-06-07-27
  • since: pk-05-11-22
DBMS_TREE_NODE newChildObj (array $dbRow, boolean $debug)
  • array $dbRow
  • boolean $debug

Redefined in descendants as:
  • CMS_MENU_NODE::newChildObj() : creates a child object out of database row checks $dbRow['MEN_OBJCLASS'] to determine the class of the new object
newTreeObj (line 365)
  • version: pk-07-08-09 use setObjVarIfEmpty()
  • since: pk-05-07-12
  • access: protected
DBMS_TREE &newTreeObj ([boolean $debug = False])
  • boolean $debug
numberOfChildren (line 1246)

return the number of childrens

int numberOfChildren ([boolean $useCache = TRUE], [boolean $debug = FALSE])
  • boolean $useCache
  • boolean $debug
populateChildren (line 901)

populates the children

if $useCache and a child object exists in the database this object is used else a new object is created and stored to the global array (cache) the cached values are overritten

  • return: ($this->myChildrenPopulateTS)
  • version: pk-05-07-08
  • version: pk-05-07-25
  • version: pk-05-12-12 changeParent added
  • access: protected
double populateChildren ([boolean $useCache = True], [boolean $debug = False])
  • boolean $useCache
  • boolean $debug

Redefined in descendants as:
populateTree (line 991)

populates the hole tree structure

void populateTree ([boolean $useCache = TRUE], [boolean $debug = FALSE])
  • boolean $useCache
  • boolean $debug
resortChildren (line 1076)

resorts the children list and saves it to the database

  • version: pk-07-08-24
  • since: pk-05-07-08
void resortChildren ([boolean $debug = FALSE], [boolean $autosave = TRUE])
  • boolean $debug
  • boolean $autosave
setChildClassVar (line 724)

sets child class vars

  • version: pk-05-01-06
  • version: pk-07-08-13 replaced some settings
void setChildClassVar ( &$child, &DBMS_TREE_NODE $child)
  • &DBMS_TREE_NODE $child
  • &$child

Redefined in descendants as:
setConfigurationArr (line 229)

sets configuration attributes (if not set) out of an array

  • since: pk-07-08-15
void setConfigurationArr (array $confArr, [boolean $debug = FALSE])
  • array $confArr
  • boolean $debug
setId (line 270)

sets the id

  • since: pk-03-12-23
void setId (int $aId)
  • int $aId
setLevel (line 290)

sets the Level

void setLevel (int $aLevel)
  • int $aLevel
setLink (line 333)

sets the link url for the output

void setLink (string $aLink)
  • string $aLink
setOrderNr (line 317)

sets the OrderNr

void setOrderNr (int $aOrderNr)
  • int $aOrderNr
setParentId (line 557)

sets the parent id

  • version: pk-07-06-19
  • access: public
void setParentId (int $aId)
  • int $aId
setParentObj (line 616)
void setParentObj ( &$aParent, DBMS_TREE_NODE $aParent)

Redefined in descendants as:
setTreeObj (line 436)

sets the tree object

  • since: pk-06-07-26
void setTreeObj ( &$aTree, DBMS_TREE $aTree)

Inherited Methods

Inherited From DBMS_TABLEOBJ

 DBMS_TABLEOBJ::DBMS_TABLEOBJ()
 DBMS_TABLEOBJ::cacheRestore()
 DBMS_TABLEOBJ::cacheWriteTo()
 DBMS_TABLEOBJ::clearErrors()
 DBMS_TABLEOBJ::dbDelete()
 DBMS_TABLEOBJ::dbGetDataArray()
 DBMS_TABLEOBJ::dbGetForm()
 DBMS_TABLEOBJ::dbInsert()
 DBMS_TABLEOBJ::dbPopulate()
 DBMS_TABLEOBJ::dbReplace()
 DBMS_TABLEOBJ::dbSave()
 DBMS_TABLEOBJ::db_SetKey()
 DBMS_TABLEOBJ::db_SetKeyArray()
 DBMS_TABLEOBJ::getClassInclude()
 DBMS_TABLEOBJ::getDbDesc()
 DBMS_TABLEOBJ::getDBField()
 DBMS_TABLEOBJ::getDBRow()
 DBMS_TABLEOBJ::getDBVal()
 DBMS_TABLEOBJ::getDefaults()
 DBMS_TABLEOBJ::getErrorMsg()
 DBMS_TABLEOBJ::getFieldDBDefault()
 DBMS_TABLEOBJ::getForm()
 DBMS_TABLEOBJ::getFormClassName()
 DBMS_TABLEOBJ::getFormName()
 DBMS_TABLEOBJ::getJSON()
 DBMS_TABLEOBJ::getKeyArr()
 DBMS_TABLEOBJ::getMyTable()
 DBMS_TABLEOBJ::getObjValArray()
 DBMS_TABLEOBJ::getObjValValue()
 DBMS_TABLEOBJ::getPopulateTs()
 DBMS_TABLEOBJ::getWhere()
 DBMS_TABLEOBJ::hasChanged()
 DBMS_TABLEOBJ::hasColumn()
 DBMS_TABLEOBJ::hasErrors()
 DBMS_TABLEOBJ::hasObjVals()
 DBMS_TABLEOBJ::init()
 DBMS_TABLEOBJ::isInit()
 DBMS_TABLEOBJ::isPopulated()
 DBMS_TABLEOBJ::keysAreSet()
 DBMS_TABLEOBJ::populateFromKeys()
 DBMS_TABLEOBJ::populateFromValues()
 DBMS_TABLEOBJ::populateObjVals()
 DBMS_TABLEOBJ::p_cacheIsExpired()
 DBMS_TABLEOBJ::saveLinkedRow()
 DBMS_TABLEOBJ::saveLinkedTableRows()
 DBMS_TABLEOBJ::saveObjVals()
 DBMS_TABLEOBJ::setChanged()
 DBMS_TABLEOBJ::setDBField()
 DBMS_TABLEOBJ::setDBFieldIfDiff()
 DBMS_TABLEOBJ::setDBFieldIfEmpty()
 DBMS_TABLEOBJ::setDBRow()
 DBMS_TABLEOBJ::setDBVal()
 DBMS_TABLEOBJ::setDefaults()
 DBMS_TABLEOBJ::setError()
 DBMS_TABLEOBJ::setLinkedTableRow()
 DBMS_TABLEOBJ::setMyTable()
 DBMS_TABLEOBJ::setObjValArray()
 DBMS_TABLEOBJ::setObjValValue()
 DBMS_TABLEOBJ::setObjVarIfEmpty()
 DBMS_TABLEOBJ::setUnChanged()
 DBMS_TABLEOBJ::userIsAllowed()
 DBMS_TABLEOBJ::writeDebugInfo()
 DBMS_TABLEOBJ::xmladdDOMElement()
 DBMS_TABLEOBJ::xmlExport()
 DBMS_TABLEOBJ::_getCacheFileName()
 DBMS_TABLEOBJ::_getDBFields()

Inherited From OCSP_OBJ

 OCSP_OBJ::castObj()
 OCSP_OBJ::cloneMe()
 OCSP_OBJ::currentUser()
 OCSP_OBJ::dbConnect()
 OCSP_OBJ::defaultDBObj()
 OCSP_OBJ::defaultReadDBObj()
 OCSP_OBJ::defaultWriteDBObj()
 OCSP_OBJ::getConf()
 OCSP_OBJ::getDBObj()
 OCSP_OBJ::get_myClassConstant()
 OCSP_OBJ::get_myObject_vars()
 OCSP_OBJ::get_mySourceFile()
 OCSP_OBJ::isConnected()
 OCSP_OBJ::isMultiByteStr()
 OCSP_OBJ::isUTF8()
 OCSP_OBJ::setConf()
 OCSP_OBJ::setDBObj()
 OCSP_OBJ::set_myObject_vars()
 OCSP_OBJ::set_myVarsFrom()
Class Constants

Inherited Constants

Inherited from DBMS_TABLEOBJ

DBMS_TABLEOBJ::CLASS_SRC_FILE

Inherited from OCSP_OBJ

OCSP_OBJ::CLASS_SRC_FILE

Documentation generated on Thu, 08 Jan 2009 17:44:04 +0100 by phpDocumentor 1.4.0a2