ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 $DIC;
87 $ilDB = $DIC['ilDB'];
88
89 parent::read();
90
91 $obj_set = $ilDB->queryF(
92 'SELECT * FROM sc_manifest WHERE obj_id = %s',
93 array('integer'),
94 array($this->getId())
95 );
96 $obj_rec = $ilDB->fetchAssoc($obj_set);
97
98 $this->setImportId($obj_rec["import_id"]);
99 $this->setVersion($obj_rec["version"]);
100 $this->setXmlBase($obj_rec["xml_base"]);
101 }
102
103 public function create()
104 {
105 global $DIC;
106 $ilDB = $DIC['ilDB'];
107
108 parent::create();
109
110 $ilDB->manipulateF(
111 '
112 INSERT INTO sc_manifest (obj_id, import_id, version, xml_base)
113 VALUES (%s,%s,%s,%s)',
114 array('integer','text','text','text'),
115 array($this->getId(),$this->getImportId(),$this->getVersion(),$this->getXmlBase())
116 );
117 }
118
119 public function update()
120 {
121 global $DIC;
122 $ilDB = $DIC['ilDB'];
123
125
126 $ilDB->manipulateF(
127 '
128 UPDATE sc_manifest
129 SET import_id = %s,
130 version = %s,
131 xml_base = %s
132 WHERE obj_id = %s',
133 array('text','text','text','integer'),
134 array($this->getImportId(),$this->getVersion(),$this->getXmlBase(),$this->getId())
135 );
136 }
137
138 public function delete()
139 {
140 global $DIC;
141 $ilDB = $DIC['ilDB'];
142
143 parent::delete();
144
145 $ilDB->manipulateF('DELETE FROM sc_manifest WHERE obj_id = %s', array('integer'), array($this->getId()));
146 }
147}
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 $DIC
Definition: saml.php:7
global $ilDB