Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Elem {
- /**
- * @var int
- */
- private $id;
- /**
- * @var string
- */
- private $data;
- /**
- * @var array
- */
- private $children = array();
- /**
- * @var Elem
- */
- private $parent;
- /**
- * @return int;
- */
- public function getId () {
- return $this->id;
- }
- /**
- * @return string;
- */
- public function getData () {
- return $this->data;
- }
- /**
- * @return array;
- */
- public function getChildren () {
- return $this->children;
- }
- /**
- * @return Elem;
- */
- public function getParent () {
- return $this->parent;
- }
- /**
- * @param int $id
- */
- public function setId ($id) {
- $this->id = $id;
- }
- /**
- * @param string $data
- */
- public function setData ($data) {
- $this->data = $data;
- }
- /**
- * @param Elem $children
- */
- public function addChild (Elem $child) {
- $this->children[] = $child;
- }
- /**
- * @param array $children
- */
- public function setChildren (array $children) {
- $this->children = $children;
- }
- /**
- * @param Elem|null $parent
- */
- public function setParent ($parent) {
- $this->parent = $parent;
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement