19declare(strict_types=1);
32 protected string $title,
33 protected string $content,
34 protected int $context_obj_id,
35 protected string $context_obj_type,
36 protected int $context_sub_obj_id,
37 protected ?
string $context_sub_obj_type,
38 protected string $content_type,
39 protected \DateTimeImmutable $creation_date,
40 protected \DateTimeImmutable $update_date,
42 protected int $update_user_id,
43 protected string $visibility,
44 protected string $content_long,
45 protected int $priority,
46 protected bool $content_is_lang_var,
47 protected bool $content_text_is_lang_var,
48 protected int $mob_id,
49 protected string $playtime,
50 protected int $mob_cnt_play,
51 protected int $mob_cnt_download,
52 protected bool $content_html,
53 protected int $context_ref_id = 0
64 return $this->content_text_is_lang_var;
74 return $this->content;
79 return $this->context_obj_id;
84 return $this->context_ref_id;
89 return $this->context_obj_type;
94 return $this->context_sub_obj_id;
99 return $this->context_sub_obj_type;
104 return $this->content_type;
109 return $this->creation_date;
114 return $this->update_date;
124 return $this->update_user_id;
129 return $this->visibility;
134 return $this->content_long;
139 return $this->priority;
144 return $this->content_is_lang_var;
149 return $this->mob_id;
154 return $this->playtime;
159 return $this->mob_cnt_play;
164 return $this->mob_cnt_download;
169 return $this->content_html;
175 $clone = clone $this;
176 $clone->context_ref_id = $context_ref_id;
182 $clone = clone $this;
183 $clone->content = $content;
189 $clone = clone $this;
190 $clone->content_long = $content_long;
199 'title' => $this->title,
200 'content' => $this->content,
201 'context_obj_id' => $this->context_obj_id,
202 'context_obj_type' => $this->context_obj_type,
203 'context_sub_obj_id' => $this->context_sub_obj_id,
204 'context_sub_obj_type' => $this->context_sub_obj_type,
205 'content_type' => $this->content_type,
206 'creation_date' => $this->creation_date->format(
'Y-m-d H:i:s'),
207 'update_date' => $this->update_date->format(
'Y-m-d H:i:s'),
209 'update_user_id' => $this->update_user_id,
210 'visibility' => $this->visibility,
211 'content_long' => $this->content_long,
212 'priority' => $this->priority,
213 'content_is_lang_var' => $this->content_is_lang_var,
214 'content_text_is_lang_var' => $this->content_text_is_lang_var,
215 'mob_id' => $this->mob_id,
216 'playtime' => $this->playtime,
217 'mob_cnt_play' => $this->mob_cnt_play,
218 'mob_cnt_download' => $this->mob_cnt_download,
219 'content_html' => $this->content_html
225 $item = new \ilNewsItem(0);
226 $item->setId($this->
id);
227 $item->setTitle($this->title);
228 $item->setContent($this->content);
229 $item->setContextObjId($this->context_obj_id);
230 $item->setContextObjType($this->context_obj_type);
231 $item->setContextSubObjId($this->context_sub_obj_id);
232 $item->setContextSubObjType($this->context_sub_obj_type);
233 $item->setContentType($this->content_type);
234 $item->setCreationDate($this->creation_date->format(
'Y-m-d H:i:s'));
235 $item->setUpdateDate($this->update_date->format(
'Y-m-d H:i:s'));
236 $item->setUserId($this->user_id);
237 $item->setUpdateUserId($this->update_user_id);
238 $item->setVisibility($this->visibility);
239 $item->setContentLong($this->content_long);
240 $item->setPriority($this->priority);
241 $item->setContentIsLangVar($this->content_is_lang_var);
242 $item->setContentTextIsLangVar($this->content_text_is_lang_var);
243 $item->setMobId($this->mob_id);
244 $item->setPlaytime($this->playtime);
245 $item->setMobPlayCounter($this->mob_cnt_play);
246 $item->setMobDownloadCounter($this->mob_cnt_download);
247 $item->setContentHtml($this->content_html);
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
News Item DTO for transfer of news items.
__construct(protected int $id, protected string $title, protected string $content, protected int $context_obj_id, protected string $context_obj_type, protected int $context_sub_obj_id, protected ?string $context_sub_obj_type, protected string $content_type, protected \DateTimeImmutable $creation_date, protected \DateTimeImmutable $update_date, protected int $user_id, protected int $update_user_id, protected string $visibility, protected string $content_long, protected int $priority, protected bool $content_is_lang_var, protected bool $content_text_is_lang_var, protected int $mob_id, protected string $playtime, protected int $mob_cnt_play, protected int $mob_cnt_download, protected bool $content_html, protected int $context_ref_id=0)
withContent(string $content)
withContextRefId(int $context_ref_id)
withContentLong(string $content_long)
A news item can be created by different sources.