ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilForumPostsTree.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2012 ILIAS open source, Extended GPL, see docs/LICENSE */
3
12{
13
14 private $thr_fk = 0;
15 private $pos_fk = 0;
16 private $parent_pos = 0;
17 private $lft = 0;
18 private $rgt = 0;
19 private $depth = 0;
20
21 private $source_thread_id = 0;
22 private $target_thread_id = 0;
23
24 public function setDepth($depth)
25 {
26 $this->depth = $depth;
27 }
28
29 public function getDepth()
30 {
31 return $this->depth;
32 }
33
34 public function setLft($lft)
35 {
36 $this->lft = $lft;
37 }
38
39 public function getLft()
40 {
41 return $this->lft;
42 }
43
44 public function setParentPos($parent_pos)
45 {
46 $this->parent_pos = $parent_pos;
47 }
48
49 public function getParentPos()
50 {
51 return $this->parent_pos;
52 }
53
54 public function setPosFk($pos_fk)
55 {
56 $this->pos_fk = $pos_fk;
57 }
58
59 public function getPosFk()
60 {
61 return $this->pos_fk;
62 }
63
64 public function setRgt($rgt)
65 {
66 $this->rgt = $rgt;
67 }
68
69 public function getRgt()
70 {
71 return $this->rgt;
72 }
73
74 public function setThrFk($thr_fk)
75 {
76 $this->thr_fk = $thr_fk;
77 }
78
79 public function getThrFk()
80 {
81 return $this->thr_fk;
82 }
83
85 {
86 $this->source_thread_id = $source_thread_id;
87 }
88
89 public function getSourceThreadId()
90 {
92 }
93
95 {
96 $this->target_thread_id = $target_thread_id;
97 }
98
99 public function getTargetThreadId()
100 {
102 }
103
104 public function __construct()
105 {
106
107 }
108
109 public function mergeParentPos()
110 {
111 global $ilDB;
112
113 $ilDB->update('frm_posts_tree',
114 array(
115 'parent_pos' => array('integer', $this->getParentPos()),
116 'lft' => array('integer', $this->getLft()),
117 'rgt' => array('integer', $this->getRgt()),
118 'depth' => array('integer', $this->getDepth()),
119 'thr_fk' => array('integer', $this->getTargetThreadId())
120 ),
121 array(
122 'pos_fk' => array('integer', $this->getPosFk()),
123 'parent_pos' => array('integer', 0),
124 'thr_fk' => array('integer', $this->getSourceThreadId())
125 ));
126 }
127 public function merge()
128 {
129 global $ilDB;
130 $ilDB->update('frm_posts_tree',
131 array(
132 'lft' => array('integer', $this->getLft()),
133 'rgt' => array('integer', $this->getRgt()),
134 'depth' => array('integer', $this->getDepth()),
135 'thr_fk' => array('integer', $this->getTargetThreadId())
136 ),
137 array(
138 'pos_fk' => array('integer', $this->getPosFk()),
139 'parent_pos' => array('integer', $this->getParentPos()),
140 'thr_fk' => array('integer', $this->getSourceThreadId())
141 ));
142 }
143
144 /***
145 * @param integer $root_node_id
146 * @param integer $rgt
147 */
148 public static function updateTargetRootRgt($root_node_id, $rgt)
149 {
150 global $ilDB;
151
152 $ilDB->update('frm_posts_tree',
153 array(
154 'rgt' => array('integer', $rgt)),
155 array(
156 'parent_pos' => array('integer', 0),
157 'pos_fk' => array('integer', $root_node_id)
158 ));
159 }
160}
setSourceThreadId($source_thread_id)
static updateTargetRootRgt($root_node_id, $rgt)
setTargetThreadId($target_thread_id)
global $ilDB