ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilSCORM2004SeqNode.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2008 ILIAS open source, University of Cologne |
7  | |
8  | This program is free software; you can redistribute it and/or |
9  | modify it under the terms of the GNU General Public License |
10  | as published by the Free Software Foundation; either version 2 |
11  | of the License, or (at your option) any later version. |
12  | |
13  | This program is distributed in the hope that it will be useful, |
14  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16  | GNU General Public License for more details. |
17  | |
18  | You should have received a copy of the GNU General Public License |
19  | along with this program; if not, write to the Free Software |
20  | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21  +-----------------------------------------------------------------------------+
22 */
23 
24 
36 {
37 
38 
39  protected $db = null;
40 
41  //db fields
42  private $nodeName = null;
43  private $treenodeId = null;
44 
49  function ilSCORM2004SeqNode()
50  {
51  global $ilDB;
52  $this->db = $ilDB;
53  }
54 
55 
56  // **********************
57  // GETTER METHODS
58  // **********************
59 
60  public function getNodeName()
61  {
62  return $this->nodeName;
63  }
64 
65  public function getTreenodeId()
66  {
67  return $this->treenodeId;
68  }
69 
70 
71  // **********************
72  // Setter METHODS
73  // **********************
74 
75  public function setNodeName($a_nodeName)
76  {
77  $this->nodeName = $a_nodeName;
78  }
79 
80  public function setTreenodeId($a_treenodeId)
81  {
82  $this->treenodeId = $a_treenodeId;
83  }
84 
85 
86  // **********************
87  // Standard DB Operations for Object
88  // **********************
89 
90  public function insert()
91  {
92  $next_id = $this->db->nextId("sahs_sc13_seq_node");
93  $sql = "INSERT INTO sahs_sc13_seq_node (seqnodeid, tree_node_id,nodename)".
94  " values(".
95  $this->db->quote($next_id, "integer").",".
96  $this->db->quote($this->treenodeId, "integer").",".
97  $this->db->quote($this->nodeName, "text").");";
98  $result = $this->db->manipulate($sql);
99  return $next_id();
100  }
101 
102  public function update($a_seq_node_id)
103  {
104  $sql = "UPDATE sahs_sc13_seq_node SET ".
105  "tree_node_id = ".$this->db->quote($this->treenodeId, "integer").",".
106  "nodename=".$this->db->quote($this->nodeName, "text").
107  " WHERE seqnodeid=".$this->db->quote($a_seq_node_id, "integer");
108  $result = $this->db->manipulate($sql);
109  return;
110  }
111 
112 
113 }
114 ?>