ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilSCORMOrganization.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
29{
30 public string $import_id;
31 public ?string $structure = null;
32
37 public function __construct(int $a_id = 0)
38 {
40 $this->setType('sor');
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 }
52
53 public function getStructure(): ?string
54 {
55 return $this->structure;
56 }
57
58 public function setStructure(?string $a_structure): void
59 {
60 $this->structure = $a_structure;
61 }
62
63 public function read(): void
64 {
65 global $DIC;
66 $ilDB = $DIC->database();
67
68 parent::read();
69
70 $query = 'SELECT import_id, structure FROM sc_organization WHERE obj_id = %s';
71 $obj_set = $ilDB->queryF(
72 $query,
73 array('integer'),
74 array($this->getId())
75 );
76 $obj_rec = $ilDB->fetchAssoc($obj_set);
77
78 $this->setImportId($obj_rec['import_id']);
79 $this->setStructure($obj_rec['structure']);
80 }
81
82 public function create(): void
83 {
84 global $DIC;
85 $ilDB = $DIC->database();
86
87 parent::create();
88
89 $query = 'INSERT INTO sc_organization (obj_id, import_id, structure) VALUES(%s, %s, %s)';
90 $ilDB->manipulateF(
91 $query,
92 array('integer', 'text', 'text'),
93 array($this->getId(), $this->getImportId(), $this->getStructure())
94 );
95 }
96
97 public function update(): void
98 {
99 global $DIC;
100 $ilDB = $DIC->database();
101
102 parent::update();
103
104 $query = 'UPDATE sc_organization SET import_id = %s, structure = %s WHERE obj_id = %s';
105 $ilDB->manipulateF(
106 $query,
107 array('text', 'text', 'integer'),
108 array($this->getImportId(), $this->getStructure(), $this->getId())
109 );
110 }
111
112 public function delete(): void
113 {
114 global $DIC;
115 $ilDB = $DIC->database();
116
117 parent::delete();
118
119 $query = 'DELETE FROM sc_organization WHERE obj_id = %s';
120 $ilDB->manipulateF(
121 $query,
122 array('integer'),
123 array($this->getId())
124 );
125 }
126}
Parent object for all SCORM objects, that are stored in table scorm_object.
setType(?string $a_type)
create()
Create database record for SCORM object.
setStructure(?string $a_structure)
update()
Updates database record for SCORM object.
setImportId(string $a_import_id)
__construct(int $a_id=0)
Constructor.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26