3 declare(strict_types=1);
33 if (count($uploads) > 0) {
34 foreach ($uploads as $pre =>
$info) {
35 $settings = $this->ls_filesystem->moveUploaded($pre,
$info, $settings);
40 if (count($deletions) > 0) {
41 foreach ($deletions as $pre) {
42 $settings = $this->ls_filesystem->delete_image($pre, $settings);
47 "obj_id" => array(
"integer", $settings->
getObjId())
51 "abstract" => array(
"text", $settings->
getAbstract()),
52 "extro" => array(
"text", $settings->
getExtro()),
58 $this->database->update(static::TABLE_NAME,
$values, $where);
61 public function delete(
int $obj_id)
66 $settings = $this->ls_filesystem->delete_image($pre, $settings);
70 "DELETE FROM " . static::TABLE_NAME .
PHP_EOL 71 .
"WHERE obj_id = " . $this->database->quote($obj_id,
"integer") .
PHP_EOL 74 $this->database->manipulate(
$query);
81 if (count(
$data) == 0) {
89 $data[
'abstract_image'],
91 (
bool)
$data[
'gallery']
98 protected function select(
int $obj_id) : array
102 "SELECT abstract, extro, abstract_image, extro_image, gallery" .
PHP_EOL 103 .
"FROM " . static::TABLE_NAME .
PHP_EOL 104 .
"WHERE obj_id = " . $this->database->quote($obj_id,
"integer") .
PHP_EOL 109 if (
$result->numRows() !== 0) {
118 string $abstract =
'',
120 string $abstract_image = null,
121 string $extro_image = null,
122 bool $gallery =
false 137 "obj_id" => array(
"integer", $settings->
getObjId()),
138 "abstract" => array(
"text", $settings->
getAbstract()),
139 "extro" => array(
"text", $settings->
getExtro()),
142 $this->database->insert(static::TABLE_NAME,
$values);
getSettingsFor(int $lso_obj_id)
Storage of images in settings.
store(ilLearningSequenceSettings $settings)
Settings for an LSO (like abstract, extro)
Persistence for Settings (like abstract, extro)
insert(ilLearningSequenceSettings $settings)
__construct(ilDBInterface $database, ilLearningSequenceFilesystem $ls_filesystem)
buildSettings(int $obj_id, string $abstract='', string $extro='', string $abstract_image=null, string $extro_image=null, bool $gallery=false)