ILIAS  trunk Revision v11.0_alpha-1749-g1a06bdef097
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilSCORMObject Class Reference

Parent object for all SCORM objects, that are stored in table scorm_object. 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

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

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

References $DIC, and $ilDB.

Referenced by ilObjSAHSLearningModule\delete().

184  {
185  global $DIC;
186  $ilDB = $DIC->database();
187 
188  $sc_set = $ilDB->queryF(
189  '
190  SELECT c_type FROM scorm_object
191  WHERE obj_id = %s
192  AND slm_id = %s',
193  array('integer','integer'),
194  array($a_id, $a_slm_id)
195  );
196  $sc_rec = $ilDB->fetchAssoc($sc_set);
197 
198  switch ($sc_rec["c_type"]) {
199  case "sit": $item = new ilSCORMItem($a_id);
200  return $item;
201 
202  case "sos": $sos = new ilSCORMOrganizations($a_id);
203  return $sos;
204 
205  case "sor": $sor = new ilSCORMOrganization($a_id);
206  return $sor;
207 
208  case "sma": $sma = new ilSCORMManifest($a_id);
209  return $sma;
210 
211  case "srs": $srs = new ilSCORMResources($a_id);
212  return $srs;
213 
214  default:
215  case "sre": $sre = new ilSCORMResource($a_id);
216  return $sre;
217  }
218  }
global $DIC
Definition: shib_login.php:22
SCORM Item.
SCORM Resources Element.
+ 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: shib_login.php:22
+ 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: shib_login.php:22
+ 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: shib_login.php:22
+ 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: shib_login.php:22
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: shib_login.php:22
+ 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: