ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilSCORMResources.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
29{
30 public ?string $xml_base = null;
31
36 public function __construct(int $a_id = 0)
37 {
38 global $DIC;
39 $lng = $DIC->language();
40
42 $this->setType('srs');
43
44 $this->setTitle($lng->txt('cont_resources'));
45 }
46
47 public function getXmlBase(): ?string
48 {
49 return $this->xml_base;
50 }
51
52 public function setXmlBase(?string $a_xml_base): void
53 {
54 $this->xml_base = $a_xml_base;
55 }
56
57 public function read(): void
58 {
59 global $DIC;
60 $ilDB = $DIC->database();
61
62 parent::read();
63
64 $obj_set = $ilDB->queryF(
65 'SELECT xml_base FROM sc_resources WHERE obj_id = %s',
66 array('integer'),
67 array($this->getId())
68 );
69 $obj_rec = $ilDB->fetchAssoc($obj_set);
70 $this->setXmlBase($obj_rec['xml_base']);
71 }
72
73 public function create(): void
74 {
75 global $DIC;
76 $ilDB = $DIC->database();
77
78 parent::create();
79
80 $ilDB->manipulateF(
81 'INSERT INTO sc_resources (obj_id, xml_base) VALUES (%s, %s)',
82 array('integer', 'text'),
83 array($this->getId(), $this->getXmlBase())
84 );
85 }
86
87 public function update(): void
88 {
89 global $DIC;
90 $ilDB = $DIC->database();
91
92 parent::update();
93
94 $ilDB->manipulateF(
95 '
96 UPDATE sc_resources SET xml_base = %s WHERE obj_id = %s',
97 array('text', 'integer'),
98 array($this->getXmlBase() ,$this->getId())
99 );
100 }
101
102 public function delete(): void
103 {
104 global $DIC;
105 $ilDB = $DIC->database();
106
107 parent::delete();
108
109 $ilDB->manipulateF(
110 'DELETE FROM sc_resources WHERE obj_id = %s',
111 array('integer'),
112 array($this->getId())
113 );
114 }
115}
Parent object for all SCORM objects, that are stored in table scorm_object.
setTitle(string $a_title)
setType(?string $a_type)
SCORM Resources Element.
__construct(int $a_id=0)
Constructor.
update()
Updates database record for SCORM object.
setXmlBase(?string $a_xml_base)
create()
Create database record for SCORM object.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $lng
Definition: privfeed.php:31
global $DIC
Definition: shib_login.php:26