ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilSCORMOrganizations.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{
37
38
45 public function __construct($a_id = 0)
46 {
47 global $DIC;
48 $lng = $DIC['lng'];
49
50 // title should be overrriden by ilSCORMExplorer
51 $this->setTitle($lng->txt("cont_organizations"));
52
54 $this->setType("sos");
55 }
56
57 public function getDefaultOrganization()
58 {
60 }
61
62 public function setDefaultOrganization($a_def_org)
63 {
64 $this->default_organization = $a_def_org;
65 }
66
67 public function read()
68 {
69 global $DIC;
70 $ilDB = $DIC['ilDB'];
71
72 parent::read();
73
74 $obj_set = $ilDB->queryF(
75 'SELECT default_organization FROM sc_organizations WHERE obj_id = %s',
76 array('integer'),
77 array($this->getId())
78 );
79 $obj_rec = $ilDB->fetchAssoc($obj_set);
80 $this->setDefaultOrganization($obj_rec["default_organization"]);
81 }
82
83 public function create()
84 {
85 global $DIC;
86 $ilDB = $DIC['ilDB'];
87
88 parent::create();
89
90 $ilDB->manipulateF(
91 '
92 INSERT INTO sc_organizations (obj_id, default_organization) VALUES (%s, %s)',
93 array('integer', 'text'),
94 array($this->getId(), $this->getDefaultOrganization())
95 );
96 }
97
98 public function update()
99 {
100 global $DIC;
101 $ilDB = $DIC['ilDB'];
102
103 parent::update();
104
105 $ilDB->manipulateF(
106 '
107 UPDATE sc_organizations
108 SET default_organization = %s
109 WHERE obj_id = %s',
110 array('text', 'integer'),
111 array($this->getDefaultOrganization(), $this->getId())
112 );
113 }
114
115 public function delete()
116 {
117 global $DIC;
118 $ilDB = $DIC['ilDB'];
119
120 parent::delete();
121
122 $ilDB->manipulateF(
123 'DELETE FROM sc_organizations WHERE obj_id = %s',
124 array('integer'),
125 array($this->getId())
126 );
127 }
128}
An exception for terminatinating execution or to throw for unit testing.
Parent object for all SCORM objects, that are stored in table scorm_object.
update()
Updates database record for SCORM object.
create()
Create database record for SCORM object.
__construct($a_id=0)
Constructor.
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$lng
global $ilDB