ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilSCORMManifest.php
Go to the documentation of this file.
1<?php
2/*
3 +-----------------------------------------------------------------------------+
4 | ILIAS open source |
5 +-----------------------------------------------------------------------------+
6 | Copyright (c) 1998-2001 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
24require_once("./Modules/ScormAicc/classes/SCORM/class.ilSCORMObject.php");
25
35{
36 public $import_id;
37 public $version;
38 public $xml_base;
39
40
47 public function __construct($a_id = 0)
48 {
49 parent::__construct($a_id);
50 $this->setType("sma");
51 }
52
53 public function getImportId()
54 {
55 return $this->import_id;
56 }
57
58 public function setImportId($a_import_id)
59 {
60 $this->import_id = $a_import_id;
61 $this->setTitle($a_import_id);
62 }
63
64 public function getVersion()
65 {
66 return $this->version;
67 }
68
69 public function setVersion($a_version)
70 {
71 $this->version = $a_version;
72 }
73
74 public function getXmlBase()
75 {
76 return $this->xml_base;
77 }
78
79 public function setXmlBase($a_xml_base)
80 {
81 $this->xml_base = $a_xml_base;
82 }
83
84 public function read()
85 {
86 global $ilDB;
87
88 parent::read();
89
90 $obj_set = $ilDB->queryF(
91 'SELECT * FROM sc_manifest WHERE obj_id = %s',
92 array('integer'),
93 array($this->getId())
94 );
95 $obj_rec = $ilDB->fetchAssoc($obj_set);
96
97 $this->setImportId($obj_rec["import_id"]);
98 $this->setVersion($obj_rec["version"]);
99 $this->setXmlBase($obj_rec["xml_base"]);
100 }
101
102 public function create()
103 {
104 global $ilDB;
105
106 parent::create();
107
108 $ilDB->manipulateF(
109 '
110 INSERT INTO sc_manifest (obj_id, import_id, version, xml_base)
111 VALUES (%s,%s,%s,%s)',
112 array('integer','text','text','text'),
113 array($this->getId(),$this->getImportId(),$this->getVersion(),$this->getXmlBase())
114 );
115 }
116
117 public function update()
118 {
119 global $ilDB;
120
122
123 $ilDB->manipulateF(
124 '
125 UPDATE sc_manifest
126 SET import_id = %s,
127 version = %s,
128 xml_base = %s
129 WHERE obj_id = %s',
130 array('text','text','text','integer'),
131 array($this->getImportId(),$this->getVersion(),$this->getXmlBase(),$this->getId())
132 );
133 }
134
135 public function delete()
136 {
137 global $ilDB;
138
139 parent::delete();
140
141 $ilDB->manipulateF('DELETE FROM sc_manifest WHERE obj_id = %s', array('integer'), array($this->getId()));
142 }
143}
An exception for terminatinating execution or to throw for unit testing.
setImportId($a_import_id)
update()
Updates database record for SCORM object.
create()
Create database record for SCORM object.
__construct($a_id=0)
Constructor.
Parent object for all SCORM objects, that are stored in table scorm_object.
update($pash, $contents, Config $config)
global $ilDB