ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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  public function __construct()
33  {
34  parent::__construct();
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) {
125  $this->setSeqNodeId(parent::insert());
126  }
127  $sql = "INSERT INTO sahs_sc13_seq_mapinfo (seqnodeid,targetobjectiveid,readsatisfiedstatus,readnormalizedmeasure,writesatisfiedstatus,writemormalizedmeasure)" .
128  " values(" .
129  $this->db->quote($this->seqNodeId, "integer") . "," .
130  $this->db->quote($this->targetObjectiveID, "text") . "," .
131  $this->db->quote($this->readSatisfiedStatus, "integer") . "," .
132  $this->db->quote($this->readNormalizedMeasure, "integer") . "," .
133  $this->db->quote($this->writeSatisfiedStatus, "integer") . "," .
134  $this->db->quote($this->writeNormalizedMeasure, "integer") . ");";
135  $result = $this->db->manipulate($sql);
136  return true;
137  }
138 
139  public static function fetchmapInfo($a_seq_node_id)
140  {
141  global $DIC;
142 
143  $ilDB = $DIC->database();
144 
145  $sql = "SELECT * FROM sahs_sc13_seq_mapinfo WHERE seqnodeid=" .
146  $ilDB->quote($a_seq_node_id, "integer") . ";";
147  $result = $ilDB->query($sql);
148  $row = $ilDB->fetchAssoc($result);
149  $obj = new ilSCORM2004MapInfo();
150  $obj->setSeqNodeId($row["seqnodeid"]);
151  $obj->setTargetObjectiveID($row["targetobjectiveid"]);
152  $obj->setReadSatisfiedStatus($row["readsatisfiedstatus"]);
153  $obj->setReadNormalizedMeasure($row["readnormalizedmeasure"]);
154  $obj->setWriteSatisfiedStatus($row["writesatisfiedstatus"]);
155  $obj->setWriteNormalizedMeasure($row["writemormalizedmeasure"]);
156  /*foreach ($row as $key=>$value) {
157  $method = "set".ucwords($key);
158  if (method_exists($obj,$method)) {$obj->$method($value);}
159  }*/
160  return $obj;
161  }
162 }
$result
global $DIC
Definition: saml.php:7
insert($a_insert_node=false)
global $ilDB
Class ilSCORM2004Condition.
static fetchmapInfo($a_seq_node_id)
Class ilSCORM2004MapInfo.
__construct()
Constructor public.