[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
No known key found for this signature in database
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,
string $content,
string $content_type,
string $language,
?string $language = null,
array $attachments = [],
array $processed_attachments = [],
array $process_note_content_extra_args = [],
@ -181,7 +181,7 @@ class Posting extends Component
'content' => $content,
'content_type' => $content_type,
'rendered' => $rendered,
'language_id' => Language::getByLocale($language)->getId(),
'language_id' => !is_null($language) ? Language::getByLocale($language)->getId() : null,
'is_local' => true,
]);

View File

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