['author-id' => $publicContact['id'], 'gravity' => [Item::GRAVITY_COMMENT, Item::GRAVITY_PARENT], 'private' => [Item::PUBLIC, Item::UNLISTED]],
['order' => ['uri-id' => true]]);
if (!empty($post['uri-id'])) {
- $status = $this->status->createFromUriId($post['uri-id'], $uid)->toArray();
+ $status = $this->status->createFromUriId($post['uri-id'], $uid);
}
}
* @param array $publicContact Full contact table record with uid = 0
* @param array $apcontact Optional full apcontact table record
* @param array $userContact Optional full contact table record with uid != 0
- * @param array $status
* @param bool $include_user_entities Whether to add the entities property
*
* @throws InternalServerErrorException
*/
- public function __construct(array $publicContact, array $apcontact = [], array $userContact = [], ?array $status = null, bool $include_user_entities = true)
+ public function __construct(array $publicContact, array $apcontact = [], array $userContact = [], ?Status $status = null, bool $include_user_entities = true)
{
$uid = $userContact['uid'] ?? 0;
$this->default_profile = false;
$this->default_profile_image = false;
- if (is_array($status)) {
- $this->status = $status;
- } else {
+ if ($status === null) {
unset($this->status);
+ } else {
+ $this->status = $status->toArray();
}
// Unused optional fields