ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilSCORM2004MapInfo.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2011 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
16 {
17 
18 
19 
20  //db fields
21  private $id = null;
22  private $seqNodeId = null;
23  private $targetObjectiveID = null;
24  private $readSatisfiedStatus = true;
25  private $readNormalizedMeasure = true;
26  private $writeSatisfiedStatus = false;
27  private $writeNormalizedMeasure = false;
32  function ilSCORM2004MapInfo()
33  {
35  $this->setNodeName("mapinfo");
36  }
37 
38 
39  // **********************
40  // GETTER METHODS
41  // **********************
42 
43  public function getSeqNodeId()
44  {
45  return $this->seqNodeId;
46  }
47 
48  public function getId()
49  {
50  return $this->id;
51  }
52 
53  public function getTargetObjectiveID()
54  {
56  }
57 
58  public function getReadSatisfiedStatus()
59  {
61  }
62 
63  public function getReadNormalizedMeasure()
64  {
66  }
67 
68  public function getWriteSatisfiedStatus()
69  {
71  }
72 
73  public function getWriteNormalizedMeasure()
74  {
76  }
77 
78  // **********************
79  // Setter METHODS
80  // **********************
81 
82  public function setSeqNodeId($a_seqnodeid)
83  {
84  $this->seqNodeId = $a_seqnodeid;
85  }
86 
87  public function setId($a_id)
88  {
89  $this->id = $a_id;
90  }
91 
92  public function setTargetObjectiveID($a_id)
93  {
94  $this->targetObjectiveID = $a_id;
95  }
96 
97  public function setReadSatisfiedStatus($a_status)
98  {
99  $this->readSatisfiedStatus = $a_status;
100  }
101 
102  public function setReadNormalizedMeasure($a_measure)
103  {
104  $this->readNormalizedMeasure = $a_measure;
105  }
106 
107  public function setWriteSatisfiedStatus($a_status)
108  {
109  $this->writeSatisfiedStatus = $a_status ;
110  }
111 
112  public function setWriteNormalizedMeasure($a_measure)
113  {
114  $this->writeNormalizedMeasure = $a_measure;
115  }
116 
117 
118  // **********************
119  // Standard DB Operations for Object
120  // **********************
121 
122  public function insert($a_insert_node = false)
123  {
124  if ($a_insert_node==true) {$this->setSeqNodeId(parent::insert());}
125  $sql = "INSERT INTO sahs_sc13_seq_mapinfo (seqnodeid,targetobjectiveid,readsatisfiedstatus,readnormalizedmeasure,writesatisfiedstatus,writemormalizedmeasure)".
126  " values(".
127  $this->db->quote($this->seqNodeId, "integer").",".
128  $this->db->quote($this->targetObjectiveID, "text").",".
129  $this->db->quote($this->readSatisfiedStatus, "integer").",".
130  $this->db->quote($this->readNormalizedMeasure, "integer").",".
131  $this->db->quote($this->writeSatisfiedStatus, "integer").",".
132  $this->db->quote($this->writeNormalizedMeasure, "integer").");";
133  $result = $this->db->manipulate($sql);
134  return true;
135  }
136 
137  static function fetchmapInfo($a_seq_node_id)
138  {
139  global $ilDB;
140 
141  $sql = "SELECT * FROM sahs_sc13_seq_mapinfo WHERE seqnodeid=".
142  $ilDB->quote($a_seq_node_id, "integer").";";
143  $result = $ilDB->query($sql);
144  $row = $ilDB->fetchAssoc($result);
145  $obj = new ilSCORM2004MapInfo();
146  $obj->setSeqNodeId($row["seqnodeid"]);
147  $obj->setTargetObjectiveID($row["targetobjectiveid"]);
148  $obj->setReadSatisfiedStatus($row["readsatisfiedstatus"]);
149  $obj->setReadNormalizedMeasure($row["readnormalizedmeasure"]);
150  $obj->setWriteSatisfiedStatus($row["writesatisfiedstatus"]);
151  $obj->setWriteNormalizedMeasure($row["writemormalizedmeasure"]);
152  /*foreach ($row as $key=>$value) {
153  $method = "set".ucwords($key);
154  if (method_exists($obj,$method)) {$obj->$method($value);}
155  }*/
156  return $obj;
157  }
158 
159 
160 }
161 ?>