ILIAS  release_7 Revision v7.30-3-g800a261c036
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 $DIC;
48 $lng = $DIC['lng'];
49
51 $this->setType('srs');
52
53 $this->setTitle($lng->txt('cont_resources'));
54 }
55
56 public function getXmlBase()
57 {
58 return $this->xml_base;
59 }
60
61 public function setXmlBase($a_xml_base)
62 {
63 $this->xml_base = $a_xml_base;
64 }
65
66 public function read()
67 {
68 global $DIC;
69 $ilDB = $DIC['ilDB'];
70
71 parent::read();
72
73 $obj_set = $ilDB->queryF(
74 'SELECT xml_base FROM sc_resources WHERE obj_id = %s',
75 array('integer'),
76 array($this->getId())
77 );
78 $obj_rec = $ilDB->fetchAssoc($obj_set);
79 $this->setXmlBase($obj_rec['xml_base']);
80 }
81
82 public function create()
83 {
84 global $DIC;
85 $ilDB = $DIC['ilDB'];
86
87 parent::create();
88
89 $ilDB->manipulateF(
90 'INSERT INTO sc_resources (obj_id, xml_base) VALUES (%s, %s)',
91 array('integer', 'text'),
92 array($this->getId(), $this->getXmlBase())
93 );
94 }
95
96 public function update()
97 {
98 global $DIC;
99 $ilDB = $DIC['ilDB'];
100
101 parent::update();
102
103 $ilDB->manipulateF(
104 '
105 UPDATE sc_resources SET xml_base = %s WHERE obj_id = %s',
106 array('text', 'integer'),
107 array($this->getXmlBase() ,$this->getId())
108 );
109 }
110
111 public function delete()
112 {
113 global $DIC;
114 $ilDB = $DIC['ilDB'];
115
116 parent::delete();
117
118 $ilDB->manipulateF(
119 'DELETE FROM sc_resources WHERE obj_id = %s',
120 array('integer'),
121 array($this->getId())
122 );
123 }
124}
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.
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$lng
global $ilDB