ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilSCORMOrganization.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 
24 require_once("./Modules/ScormAicc/classes/SCORM/class.ilSCORMObject.php");
25 
35 {
38 
39 
46  function ilSCORMOrganization($a_id = 0)
47  {
48  parent::ilSCORMObject($a_id);
49  $this->setType('sor');
50  }
51 
52  function getImportId()
53  {
54  return $this->import_id;
55  }
56 
57  function setImportId($a_import_id)
58  {
59  $this->import_id = $a_import_id;
60  }
61 
62  function getStructure()
63  {
64  return $this->structure;
65  }
66 
67  function setStructure($a_structure)
68  {
69  $this->structure = $a_structure;
70  }
71 
72  function read()
73  {
74  global $ilDB;
75 
76  parent::read();
77 
78  $query = 'SELECT import_id, structure FROM sc_organization WHERE obj_id = %s';
79  $obj_set = $ilDB->queryF(
80  $query,
81  array('integer'),
82  array($this->getId())
83  );
84  $obj_rec = $ilDB->fetchAssoc($obj_set);
85 
86  $this->setImportId($obj_rec['import_id']);
87  $this->setStructure($obj_rec['structure']);
88  }
89 
90  function create()
91  {
92  global $ilDB;
93 
95 
96  $query = 'INSERT INTO sc_organization (obj_id, import_id, structure) VALUES(%s, %s, %s)';
97  $ilDB->manipulateF(
98  $query,
99  array('integer', 'text', 'text'),
100  array($this->getId(), $this->getImportId(), $this->getStructure())
101  );
102  }
103 
104  function update()
105  {
106  global $ilDB;
107 
108  parent::update();
109 
110  $query = 'UPDATE sc_organization SET import_id = %s, structure = %s WHERE obj_id = %s';
111  $ilDB->manipulateF(
112  $query,
113  array('text', 'text', 'integer'),
114  array($this->getImportId(), $this->getStructure(), $this->getId())
115  );
116  }
117 
118  function delete()
119  {
120  global $ilDB;
121 
122  parent::delete();
123 
124  $query = 'DELETE FROM sc_organization WHERE obj_id = %s';
125  $ilDB->manipulateF(
126  $query,
127  array('integer'),
128  array($this->getId())
129  );
130  }
131 }
132 ?>