Varien_Db_Tree_Node Class Reference

List of all members.

Public Member Functions

 __construct ($nodeData=array(), $keys)
 getData ($name)
 getLevel ()
 getLeft ()
 getRight ()
 getPid ()
 getId ()
 isParent ()

Public Attributes

 $hasChild = false
 $numChild = 0


Detailed Description

Definition at line 30 of file Node.php.


Constructor & Destructor Documentation

__construct ( nodeData = array(),
keys 
)

Definition at line 45 of file Node.php.

00045                                                      {
00046         if (empty($nodeData)) {
00047             throw new Varien_Db_Tree_Node_Exception('Empty array of node information');
00048         }
00049         if (empty($keys)) {
00050             throw new Varien_Db_Tree_Node_Exception('Empty keys array');
00051         }
00052 
00053         $this->id    = $nodeData[$keys['id']];
00054         $this->pid   = $nodeData[$keys['pid']];
00055         $this->left  = $nodeData[$keys['left']];
00056         $this->right = $nodeData[$keys['right']];
00057         $this->level = $nodeData[$keys['level']];
00058 
00059         $this->data  = $nodeData;
00060         $a = $this->right - $this->left;
00061         if ($a > 1) {
00062             $this->hasChild = true;
00063             $this->numChild = ($a - 1) / 2;
00064         }
00065         return $this;
00066     }


Member Function Documentation

getData ( name  ) 

Definition at line 68 of file Node.php.

00068                             {
00069         if (isset($this->data[$name])) {
00070             return $this->data[$name];
00071         } else {
00072             return null;
00073         }
00074     }

getId (  ) 

Definition at line 92 of file Node.php.

00092                      {
00093         return $this->id;
00094     }

getLeft (  ) 

Definition at line 80 of file Node.php.

00080                        {
00081         return $this->left;
00082     }

getLevel (  ) 

Definition at line 76 of file Node.php.

00076                         {
00077         return $this->level;
00078     }

getPid (  ) 

Definition at line 88 of file Node.php.

00088                       {
00089         return $this->pid;
00090     }

getRight (  ) 

Definition at line 84 of file Node.php.

00084                         {
00085         return $this->right;
00086     }

isParent (  ) 

Return true if node have chield

Returns:
boolean

Definition at line 101 of file Node.php.

00101                         {
00102         if ($this->right - $this->left > 1) {
00103             return true;
00104         } else {
00105             return false;
00106         }
00107     }


Member Data Documentation

$hasChild = false

Definition at line 41 of file Node.php.

$numChild = 0

Definition at line 42 of file Node.php.


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:25:01 2009 for Magento by  doxygen 1.5.8