ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilSCORMResources.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 $xml_base;
37
38
45 public function __construct($a_id = 0)
46 {
47 global $lng;
48
49 parent::__construct($a_id);
50 $this->setType('srs');
51
52 $this->setTitle($lng->txt('cont_resources'));
53 }
54
55 public function getXmlBase()
56 {
57 return $this->xml_base;
58 }
59
60 public function setXmlBase($a_xml_base)
61 {
62 $this->xml_base = $a_xml_base;
63 }
64
65 public function read()
66 {
67 global $ilDB;
68
69 parent::read();
70
71 $obj_set = $ilDB->queryF(
72 'SELECT xml_base FROM sc_resources WHERE obj_id = %s',
73 array('integer'),
74 array($this->getId())
75 );
76 $obj_rec = $ilDB->fetchAssoc($obj_set);
77 $this->setXmlBase($obj_rec['xml_base']);
78 }
79
80 public function create()
81 {
82 global $ilDB;
83
84 parent::create();
85
86 $ilDB->manipulateF(
87 'INSERT INTO sc_resources (obj_id, xml_base) VALUES (%s, %s)',
88 array('integer', 'text'),
89 array($this->getId(), $this->getXmlBase())
90 );
91 }
92
93 public function update()
94 {
95 global $ilDB;
96
98
99 $ilDB->manipulateF(
100 '
101 UPDATE sc_resources SET xml_base = %s WHERE obj_id = %s',
102 array('text', 'integer'),
103 array($this->getXmlBase() ,$this->getId())
104 );
105 }
106
107 public function delete()
108 {
109 global $ilDB;
110
111 parent::delete();
112
113 $ilDB->manipulateF(
114 'DELETE FROM sc_resources WHERE obj_id = %s',
115 array('integer'),
116 array($this->getId())
117 );
118 }
119}
An exception for terminatinating execution or to throw for unit testing.
Parent object for all SCORM objects, that are stored in table scorm_object.
SCORM Resources Element.
update()
Updates database record for SCORM object.
__construct($a_id=0)
Constructor.
create()
Create database record for SCORM object.
update($pash, $contents, Config $config)
global $lng
Definition: privfeed.php:17
global $ilDB