Advertisement
Guest User

Shock

a guest
Aug 21st, 2009
1,146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.13 KB | None | 0 0
  1. <?php
  2. class Elem {
  3.     /**
  4.      * @var int
  5.      */
  6.     private $id;
  7.     /**
  8.      * @var string
  9.      */
  10.     private $data;
  11.     /**
  12.      * @var array
  13.      */
  14.     private $children = array();
  15.     /**
  16.      * @var Elem
  17.      */
  18.     private $parent;
  19.  
  20.     /**
  21.      * @return int;
  22.      */
  23.     public function getId () {
  24.         return $this->id;
  25.     }
  26.  
  27.     /**
  28.      * @return string;
  29.      */
  30.     public function getData () {
  31.         return $this->data;
  32.     }
  33.  
  34.     /**
  35.      * @return array;
  36.      */
  37.     public function getChildren () {
  38.         return $this->children;
  39.     }
  40.  
  41.     /**
  42.      * @return Elem;
  43.      */
  44.     public function getParent () {
  45.         return $this->parent;
  46.     }
  47.  
  48.     /**
  49.      * @param int $id
  50.      */
  51.     public function setId ($id) {
  52.         $this->id = $id;
  53.     }
  54.  
  55.     /**
  56.      * @param string $data
  57.      */
  58.     public function setData ($data) {
  59.         $this->data = $data;
  60.     }
  61.    
  62.     /**
  63.      * @param Elem $children
  64.      */
  65.     public function addChild (Elem $child) {
  66.         $this->children[] = $child;
  67.     }
  68.  
  69.     /**
  70.      * @param array $children
  71.      */
  72.     public function setChildren (array $children) {
  73.         $this->children = $children;
  74.     }
  75.    
  76.     /**
  77.      * @param Elem|null $parent
  78.      */
  79.     public function setParent ($parent) {
  80.         $this->parent = $parent;
  81.     }
  82. }
  83. ?>
  84.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement