ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
class.ilLearningSequenceSettings.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
25{
26 public const MODE_LINEAR = 0;
27 public const MODE_ADAPTIVE = 1;
28
29 protected int $obj_id;
30 protected string $abstract;
31 protected string $extro;
32 protected ?string $abstract_image;
33 protected ?string $extro_image;
34 protected int $lso_mod;
35
39 protected array $uploads = [];
40
44 protected array $deletions = [];
45 protected bool $members_gallery;
46
47 public function __construct(
48 int $obj_id,
49 string $abstract = '',
50 string $extro = '',
51 ?string $abstract_image = null,
52 ?string $extro_image = null,
53 bool $members_gallery = false,
54 int $lso_mod = self::MODE_LINEAR
55 ) {
56 $this->obj_id = $obj_id;
57 $this->abstract = $abstract;
58 $this->extro = $extro;
59 $this->abstract_image = $abstract_image;
60 $this->extro_image = $extro_image;
61 $this->members_gallery = $members_gallery;
62 $this->lso_mod = $lso_mod;
63 }
64
65 public function getObjId(): int
66 {
67 return $this->obj_id;
68 }
69
70 public function getAbstract(): string
71 {
72 return $this->abstract;
73 }
74
76 {
77 $clone = clone $this;
78 $clone->abstract = $abstract;
79 return $clone;
80 }
81
82 public function getExtro(): string
83 {
84 return $this->extro;
85 }
86
88 {
89 $clone = clone $this;
90 $clone->extro = $extro;
91 return $clone;
92 }
93
94 public function getAbstractImage(): string
95 {
96 return $this->abstract_image ?? '';
97 }
98
99 public function withAbstractImage(?string $path = null): ilLearningSequenceSettings
100 {
101 $clone = clone $this;
102 $clone->abstract_image = $path;
103 return $clone;
104 }
105
106 public function getExtroImage(): string
107 {
108 return $this->extro_image ?? '';
109 }
110
111 public function withExtroImage(?string $path = null): ilLearningSequenceSettings
112 {
113 $clone = clone $this;
114 $clone->extro_image = $path;
115 return $clone;
116 }
117
121 public function getUploads(): array
122 {
123 return $this->uploads;
124 }
125
126 public function withUpload(array $upload_info, string $which): ilLearningSequenceSettings
127 {
128 $clone = clone $this;
129 $clone->uploads[$which] = $upload_info;
130 return $clone;
131 }
132
136 public function getDeletions(): array
137 {
138 return $this->deletions;
139 }
140
141 public function withDeletion(string $which): ilLearningSequenceSettings
142 {
143 $clone = clone $this;
144 $clone->deletions[] = $which;
145 return $clone;
146 }
147
148 public function getMembersGallery(): bool
149 {
151 }
152
154 {
155 $clone = clone $this;
156 $clone->members_gallery = $members_gallery;
157 return $clone;
158 }
159
160 public function getLSOMod(): int
161 {
162 return $this->lso_mod;
163 }
164
165 public function getMode(): int
166 {
167 return $this->lso_mod;
168 }
169
171 {
172 $clone = clone $this;
173 $clone->lso_mod = $lso_mod;
174 return $clone;
175 }
176
178 {
179 return $this->withLSOMod($lso_mod);
180 }
181}
Settings for an LSO (like abstract, extro)
withUpload(array $upload_info, string $which)
__construct(int $obj_id, string $abstract='', string $extro='', ?string $abstract_image=null, ?string $extro_image=null, bool $members_gallery=false, int $lso_mod=self::MODE_LINEAR)