[ENTITY][Note] Language can be null

This commit is contained in:
Diogo Peralta Cordeiro 2021-12-10 03:59:23 +00:00
parent 4992ff153b
commit b89f57ce93
Signed by: diogo
GPG Key ID: 18D2D35001FBFAB0
2 changed files with 3 additions and 3 deletions

View File

@ -168,7 +168,7 @@ class Posting extends Component
Actor $actor, Actor $actor,
string $content, string $content,
string $content_type, string $content_type,
string $language, ?string $language = null,
array $attachments = [], array $attachments = [],
array $processed_attachments = [], array $processed_attachments = [],
array $process_note_content_extra_args = [], array $process_note_content_extra_args = [],
@ -181,7 +181,7 @@ class Posting extends Component
'content' => $content, 'content' => $content,
'content_type' => $content_type, 'content_type' => $content_type,
'rendered' => $rendered, 'rendered' => $rendered,
'language_id' => Language::getByLocale($language)->getId(), 'language_id' => !is_null($language) ? Language::getByLocale($language)->getId() : null,
'is_local' => true, 'is_local' => true,
]); ]);

View File

@ -169,7 +169,7 @@ class Note extends Entity
return $this; return $this;
} }
public function getLanguageId(): int public function getLanguageId(): ?int
{ {
return $this->language_id; return $this->language_id;
} }