ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 {
36  public $import_id;
37  public $structure;
38 
39 
46  public function __construct($a_id = 0)
47  {
48  parent::__construct($a_id);
49  $this->setType('sor');
50  }
51 
52  public function getImportId()
53  {
54  return $this->import_id;
55  }
56 
57  public function setImportId($a_import_id)
58  {
59  $this->import_id = $a_import_id;
60  }
61 
62  public function getStructure()
63  {
64  return $this->structure;
65  }
66 
67  public function setStructure($a_structure)
68  {
69  $this->structure = $a_structure;
70  }
71 
72  public function read()
73  {
74  global $DIC;
75  $ilDB = $DIC['ilDB'];
76 
77  parent::read();
78 
79  $query = 'SELECT import_id, structure FROM sc_organization WHERE obj_id = %s';
80  $obj_set = $ilDB->queryF(
81  $query,
82  array('integer'),
83  array($this->getId())
84  );
85  $obj_rec = $ilDB->fetchAssoc($obj_set);
86 
87  $this->setImportId($obj_rec['import_id']);
88  $this->setStructure($obj_rec['structure']);
89  }
90 
91  public function create()
92  {
93  global $DIC;
94  $ilDB = $DIC['ilDB'];
95 
96  parent::create();
97 
98  $query = 'INSERT INTO sc_organization (obj_id, import_id, structure) VALUES(%s, %s, %s)';
99  $ilDB->manipulateF(
100  $query,
101  array('integer', 'text', 'text'),
102  array($this->getId(), $this->getImportId(), $this->getStructure())
103  );
104  }
105 
106  public function update()
107  {
108  global $DIC;
109  $ilDB = $DIC['ilDB'];
110 
111  parent::update();
112 
113  $query = 'UPDATE sc_organization SET import_id = %s, structure = %s WHERE obj_id = %s';
114  $ilDB->manipulateF(
115  $query,
116  array('text', 'text', 'integer'),
117  array($this->getImportId(), $this->getStructure(), $this->getId())
118  );
119  }
120 
121  public function delete()
122  {
123  global $DIC;
124  $ilDB = $DIC['ilDB'];
125 
126  parent::delete();
127 
128  $query = 'DELETE FROM sc_organization WHERE obj_id = %s';
129  $ilDB->manipulateF(
130  $query,
131  array('integer'),
132  array($this->getId())
133  );
134  }
135 }
__construct($a_id=0)
Constructor.
global $DIC
Definition: saml.php:7
Parent object for all SCORM objects, that are stored in table scorm_object.
$query
update($pash, $contents, Config $config)
global $ilDB