ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilSCORMManifest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
29{
30 public string $import_id;
31 public ?string $version = null;
32 public ?string $xml_base = null;
33
37 public function __construct(int $a_id = 0)
38 {
40 $this->setType("sma");
41 }
42
43 public function getImportId(): string
44 {
45 return $this->import_id;
46 }
47
48 public function setImportId(string $a_import_id): void
49 {
50 $this->import_id = $a_import_id;
51 $this->setTitle($a_import_id);
52 }
53
54 public function getVersion(): ?string
55 {
56 return $this->version;
57 }
58
59 public function setVersion(?string $a_version): void
60 {
61 $this->version = $a_version;
62 }
63
64 public function getXmlBase(): ?string
65 {
66 return $this->xml_base;
67 }
68
69 public function setXmlBase(?string $a_xml_base): void
70 {
71 $this->xml_base = $a_xml_base;
72 }
73
74 public function read(): void
75 {
76 global $DIC;
77 $ilDB = $DIC->database();
78
79 parent::read();
80
81 $obj_set = $ilDB->queryF(
82 'SELECT * FROM sc_manifest WHERE obj_id = %s',
83 array('integer'),
84 array($this->getId())
85 );
86 $obj_rec = $ilDB->fetchAssoc($obj_set);
87
88 $this->setImportId($obj_rec["import_id"]);
89 $this->setVersion($obj_rec["version"]);
90 $this->setXmlBase($obj_rec["xml_base"]);
91 }
92
93 public function create(): void
94 {
95 global $DIC;
96 $ilDB = $DIC->database();
97
98 parent::create();
99
100 $ilDB->manipulateF(
101 '
102 INSERT INTO sc_manifest (obj_id, import_id, version, xml_base)
103 VALUES (%s,%s,%s,%s)',
104 array('integer','text','text','text'),
105 array($this->getId(),$this->getImportId(),$this->getVersion(),$this->getXmlBase())
106 );
107 }
108
109 public function update(): void
110 {
111 global $DIC;
112 $ilDB = $DIC->database();
113
114 parent::update();
115
116 $ilDB->manipulateF(
117 '
118 UPDATE sc_manifest
119 SET import_id = %s,
120 version = %s,
121 xml_base = %s
122 WHERE obj_id = %s',
123 array('text','text','text','integer'),
124 array($this->getImportId(),$this->getVersion(),$this->getXmlBase(),$this->getId())
125 );
126 }
127
128 public function delete(): void
129 {
130 global $DIC;
131 $ilDB = $DIC->database();
132
133 parent::delete();
134
135 $ilDB->manipulateF('DELETE FROM sc_manifest WHERE obj_id = %s', array('integer'), array($this->getId()));
136 }
137}
setImportId(string $a_import_id)
setVersion(?string $a_version)
update()
Updates database record for SCORM object.
setXmlBase(?string $a_xml_base)
create()
Create database record for SCORM object.
Parent object for all SCORM objects, that are stored in table scorm_object.
setTitle(string $a_title)
setType(?string $a_type)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26