19declare(strict_types=1);
34 $this->db_timezone = new \DateTimeZone(
'UTC');
41 title: (
string) $row[
'title'],
42 content: (
string) $row[
'content'],
43 context_obj_id: (
int) $row[
'context_obj_id'],
44 context_obj_type: (
string) $row[
'context_obj_type'],
45 context_sub_obj_id: (
int) $row[
'context_sub_obj_id'],
46 context_sub_obj_type: $row[
'context_sub_obj_type'] ??
null,
47 content_type: (
string) $row[
'content_type'],
48 creation_date:
new DateTimeImmutable($row[
'creation_date']),
49 update_date:
new DateTimeImmutable($row[
'update_date']),
50 user_id: (
int) $row[
'user_id'],
51 update_user_id: (
int) $row[
'update_user_id'],
52 visibility: (
string) $row[
'visibility'],
53 content_long: (
string) $row[
'content_long'],
54 priority: (
int) $row[
'priority'],
55 content_is_lang_var: (
bool) $row[
'content_is_lang_var'],
56 content_text_is_lang_var: (
bool) $row[
'content_text_is_lang_var'],
57 mob_id: (
int) $row[
'mob_id'],
58 playtime: (
string) $row[
'playtime'],
59 mob_cnt_play: (
int) $row[
'mob_cnt_play'],
60 mob_cnt_download: (
int) $row[
'mob_cnt_download'],
61 content_html: (
bool) $row[
'content_html'],
62 context_ref_id: (
int) ($row[
'ref_id'] ?? 0)
Factory for creating News DTOs from database results (arrays)
readonly DateTimeZone $db_timezone
News Item DTO for transfer of news items.