ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilSCORMObject Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilSCORMObject:
+ Collaboration diagram for ilSCORMObject:

Public Member Functions

 __construct (int $a_id=0)
 Constructor. More...
 
 getId ()
 
 setId (int $a_id)
 
 getType ()
 
 setType (?string $a_type)
 
 getTitle ()
 
 setTitle (string $a_title)
 
 getSLMId ()
 
 setSLMId (int $a_slm_id)
 
 read ()
 
 create ()
 Create database record for SCORM object. More...
 
 update ()
 Updates database record for SCORM object. More...
 
 delete ()
 

Static Public Member Functions

static _lookupPresentableItems (int $a_slm_id)
 Count number of presentable SCOs/Assets of SCORM learning module. More...
 
static & _getInstance (int $a_id, int $a_slm_id)
 

Data Fields

int $id
 
string $title = ""
 
string $type = null
 
int $slm_id
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Parent object for all SCORM objects, that are stored in table scorm_object

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 28 of file class.ilSCORMObject.php.

Constructor & Destructor Documentation

◆ __construct()

ilSCORMObject::__construct ( int  $a_id = 0)

Constructor.

Parameters
int$a_idObject ID

Definition at line 39 of file class.ilSCORMObject.php.

References read().

40  {
41  $this->id = $a_id;
42  if ($a_id > 0) {
43  $this->read();
44  }
45  }
+ Here is the call graph for this function:

Member Function Documentation

◆ _getInstance()

static& ilSCORMObject::_getInstance ( int  $a_id,
int  $a_slm_id 
)
static
Returns
ilSCORMItem|ilSCORMManifest|ilSCORMOrganization|ilSCORMOrganizations|ilSCORMResource|ilSCORMResources

Definition at line 186 of file class.ilSCORMObject.php.

References $DIC, and $ilDB.

Referenced by ilObjSAHSLearningModule\delete().

187  {
188  global $DIC;
189  $ilDB = $DIC->database();
190 
191  $sc_set = $ilDB->queryF(
192  '
193  SELECT c_type FROM scorm_object
194  WHERE obj_id = %s
195  AND slm_id = %s',
196  array('integer','integer'),
197  array($a_id, $a_slm_id)
198  );
199  $sc_rec = $ilDB->fetchAssoc($sc_set);
200 
201  switch ($sc_rec["c_type"]) {
202  case "sit": $item = new ilSCORMItem($a_id);
203  return $item;
204 
205  case "sos": $sos = new ilSCORMOrganizations($a_id);
206  return $sos;
207 
208  case "sor": $sor = new ilSCORMOrganization($a_id);
209  return $sor;
210 
211  case "sma": $sma = new ilSCORMManifest($a_id);
212  return $sma;
213 
214  case "srs": $srs = new ilSCORMResources($a_id);
215  return $srs;
216 
217  default:
218  case "sre": $sre = new ilSCORMResource($a_id);
219  return $sre;
220  }
221  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the caller graph for this function:

◆ _lookupPresentableItems()

static ilSCORMObject::_lookupPresentableItems ( int  $a_slm_id)
static

Count number of presentable SCOs/Assets of SCORM learning module.

Definition at line 109 of file class.ilSCORMObject.php.

References $DIC, and $ilDB.

Referenced by ilSCORMPresentationGUI\frameset(), and ilObjSCORMTracking\storeJsApiCmi().

109  : array
110  {
111  global $DIC;
112  $ilDB = $DIC->database();
113 
114  $set = $ilDB->queryF(
115  "
116  SELECT sit.obj_id id
117  FROM scorm_object sob, sc_item sit
118  WHERE sob.slm_id = %s
119  AND sob.obj_id = sit.obj_id
120  AND sit.identifierref IS NOT NULL",
121  array('integer'),
122  array($a_slm_id)
123  );
124  $items = array();
125  while ($rec = $ilDB->fetchAssoc($set)) {
126  $items[] = $rec["id"];
127  }
128 
129  return $items;
130  }
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ create()

ilSCORMObject::create ( )

Create database record for SCORM object.

Definition at line 135 of file class.ilSCORMObject.php.

References $DIC, $ilDB, getSLMId(), getTitle(), getType(), and setId().

135  : void
136  {
137  global $DIC;
138  $ilDB = $DIC->database();
139 
140  $nextId = $ilDB->nextId('scorm_object');
141  $this->setId($nextId);
142 
143  $ilDB->manipulateF(
144  '
145  INSERT INTO scorm_object (obj_id,title, c_type, slm_id)
146  VALUES (%s,%s,%s,%s) ',
147  array('integer','text','text','integer'),
148  array($nextId, $this->getTitle(),$this->getType(), $this->getSLMId())
149  );
150  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

◆ delete()

ilSCORMObject::delete ( )

Definition at line 172 of file class.ilSCORMObject.php.

References $DIC, $ilDB, and getId().

172  : void
173  {
174  global $DIC;
175  $ilDB = $DIC->database();
176  $ilDB->manipulateF(
177  'DELETE FROM scorm_object WHERE obj_id = %s',
178  array('integer'),
179  array($this->getId())
180  );
181  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

◆ getId()

◆ getSLMId()

ilSCORMObject::getSLMId ( )

Definition at line 77 of file class.ilSCORMObject.php.

References $slm_id.

Referenced by create(), ilSCORMItem\delete(), ilSCORMItem\getTrackingDataOfUser(), and update().

77  : int
78  {
79  return $this->slm_id;
80  }
+ Here is the caller graph for this function:

◆ getTitle()

ilSCORMObject::getTitle ( )

Definition at line 67 of file class.ilSCORMObject.php.

References $title.

Referenced by create(), ilSCORMTrackingItemsScoTableGUI\initTable(), ilSCORMTrackingItemPerUserTableGUI\initTable(), and update().

67  : string
68  {
69  return $this->title;
70  }
+ Here is the caller graph for this function:

◆ getType()

ilSCORMObject::getType ( )

Definition at line 57 of file class.ilSCORMObject.php.

References $type.

Referenced by create(), and update().

57  : ?string
58  {
59  return $this->type;
60  }
+ Here is the caller graph for this function:

◆ read()

ilSCORMObject::read ( )
Returns
void

Definition at line 90 of file class.ilSCORMObject.php.

References $DIC, $ilDB, getId(), setSLMId(), setTitle(), and setType().

Referenced by __construct().

90  : void
91  {
92  global $DIC;
93  $ilDB = $DIC->database();
94 
95  $obj_set = $ilDB->queryF(
96  'SELECT * FROM scorm_object WHERE obj_id = %s',
97  array('integer'),
98  array($this->getId())
99  );
100  $obj_rec = $ilDB->fetchAssoc($obj_set);
101  $this->setTitle($obj_rec["title"]);
102  $this->setType($obj_rec["c_type"]);
103  $this->setSLMId((int) $obj_rec["slm_id"]);
104  }
setType(?string $a_type)
setSLMId(int $a_slm_id)
global $DIC
Definition: feed.php:28
setTitle(string $a_title)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setId()

ilSCORMObject::setId ( int  $a_id)

Definition at line 52 of file class.ilSCORMObject.php.

Referenced by create(), and ilSCORMResource\readByIdRef().

52  : void
53  {
54  $this->id = $a_id;
55  }
+ Here is the caller graph for this function:

◆ setSLMId()

ilSCORMObject::setSLMId ( int  $a_slm_id)

Definition at line 82 of file class.ilSCORMObject.php.

Referenced by read().

82  : void
83  {
84  $this->slm_id = $a_slm_id;
85  }
+ Here is the caller graph for this function:

◆ setTitle()

ilSCORMObject::setTitle ( string  $a_title)

Definition at line 72 of file class.ilSCORMObject.php.

Referenced by ilSCORMOrganizations\__construct(), ilSCORMResources\__construct(), read(), ilSCORMResource\setHRef(), and ilSCORMManifest\setImportId().

72  : void
73  {
74  $this->title = $a_title;
75  }
+ Here is the caller graph for this function:

◆ setType()

ilSCORMObject::setType ( ?string  $a_type)

Definition at line 62 of file class.ilSCORMObject.php.

Referenced by ilSCORMOrganizations\__construct(), ilSCORMResources\__construct(), ilSCORMManifest\__construct(), ilSCORMOrganization\__construct(), ilSCORMResource\__construct(), ilSCORMItem\__construct(), and read().

62  : void
63  {
64  $this->type = $a_type;
65  }
+ Here is the caller graph for this function:

◆ update()

ilSCORMObject::update ( )

Updates database record for SCORM object.

Definition at line 155 of file class.ilSCORMObject.php.

References $DIC, $ilDB, getId(), getSLMId(), getTitle(), and getType().

155  : void
156  {
157  global $DIC;
158  $ilDB = $DIC->database();
159 
160  $ilDB->manipulateF(
161  '
162  UPDATE scorm_object
163  SET title = %s,
164  c_type = %s,
165  slm_id = %s
166  WHERE obj_id = %s',
167  array('text','text','integer','integer'),
168  array($this->getTitle(),$this->getType(), $this->getSLMId(),$this->getId())
169  );
170  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

Field Documentation

◆ $id

int ilSCORMObject::$id

Definition at line 30 of file class.ilSCORMObject.php.

Referenced by getId().

◆ $slm_id

int ilSCORMObject::$slm_id

Definition at line 33 of file class.ilSCORMObject.php.

Referenced by getSLMId().

◆ $title

string ilSCORMObject::$title = ""

Definition at line 31 of file class.ilSCORMObject.php.

Referenced by getTitle().

◆ $type

string ilSCORMObject::$type = null

Definition at line 32 of file class.ilSCORMObject.php.

Referenced by getType().


The documentation for this class was generated from the following file: