19 declare(strict_types=1);
40 foreach ($uploads as $pre => $info) {
41 $settings = $this->ls_filesystem->moveUploaded($pre, $info, $settings);
45 foreach ($deletions as $pre) {
46 $settings = $this->ls_filesystem->delete_image($pre, $settings);
50 "obj_id" => [
"integer", $settings->
getObjId()]
55 "extro" => [
"text", $settings->
getExtro()],
61 $this->database->update(static::TABLE_NAME, $values, $where);
64 public function delete(
int $obj_id):
void 69 $settings = $this->ls_filesystem->delete_image($pre, $settings);
73 "DELETE FROM " . static::TABLE_NAME . PHP_EOL
74 .
"WHERE obj_id = " . $this->database->quote($obj_id,
"integer") . PHP_EOL
77 $this->database->manipulate($query);
84 if (count(
$data) == 0) {
92 $data[
'abstract_image'],
94 (
bool)
$data[
'gallery']
104 protected function select(
int $obj_id): array
108 "SELECT abstract, extro, abstract_image, extro_image, gallery" . PHP_EOL
109 .
"FROM " . static::TABLE_NAME . PHP_EOL
110 .
"WHERE obj_id = " . $this->database->quote($obj_id,
"integer") . PHP_EOL
113 $result = $this->database->query($query);
115 if ($this->database->numRows($result) !== 0) {
117 $ret = $this->database->fetchAssoc($result);
125 string $abstract =
'',
127 ?
string $abstract_image =
null,
128 ?
string $extro_image =
null,
129 bool $gallery =
false 144 "obj_id" => [
"integer", $settings->
getObjId()],
146 "extro" => [
"text", $settings->
getExtro()],
149 $this->database->insert(static::TABLE_NAME, $values);
getSettingsFor(int $lso_obj_id)
Storage of images in settings.
store(ilLearningSequenceSettings $settings)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
ilLearningSequenceFilesystem $ls_filesystem
Settings for an LSO (like abstract, extro)
Persistence for Settings (like abstract, extro)
insert(ilLearningSequenceSettings $settings)
buildSettings(int $obj_id, string $abstract='', string $extro='', ?string $abstract_image=null, ?string $extro_image=null, bool $gallery=false)
__construct(ilDBInterface $database, ilLearningSequenceFilesystem $ls_filesystem)