19declare(strict_types=1);
52 public function setId(
int $a_id): void
62 public function setType(?
string $a_type): void
64 $this->type = $a_type;
72 public function setTitle(
string $a_title): void
74 $this->title = $a_title;
84 $this->slm_id = $a_slm_id;
90 public function read(): void
95 $obj_set =
$ilDB->queryF(
96 'SELECT * FROM scorm_object WHERE obj_id = %s',
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"]);
114 $set =
$ilDB->queryF(
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",
125 while ($rec =
$ilDB->fetchAssoc($set)) {
126 $items[] = $rec[
"id"];
140 $nextId =
$ilDB->nextId(
'scorm_object');
141 $this->
setId($nextId);
145 INSERT INTO scorm_object (obj_id,title, c_type, slm_id)
146 VALUES (%s,%s,%s,%s) ',
147 array(
'integer',
'text',
'text',
'integer'),
167 array(
'text',
'text',
'integer',
'integer'),
172 public function delete():
void
177 'DELETE FROM scorm_object WHERE obj_id = %s',
179 array($this->
getId())
188 $sc_set =
$ilDB->queryF(
190 SELECT c_type FROM scorm_object
193 array(
'integer',
'integer'),
194 array($a_id, $a_slm_id)
196 $sc_rec =
$ilDB->fetchAssoc($sc_set);
198 switch ($sc_rec[
"c_type"]) {
Parent object for all SCORM objects, that are stored in table scorm_object.
setTitle(string $a_title)
create()
Create database record for SCORM object.
update()
Updates database record for SCORM object.
static & _getInstance(int $a_id, int $a_slm_id)
static _lookupPresentableItems(int $a_slm_id)
Count number of presentable SCOs/Assets of SCORM learning module.
__construct(int $a_id=0)
Constructor.