mirror of
https://github.com/friendica/friendica
synced 2025-05-06 10:24:10 +02:00
Use Status object in User object
This commit is contained in:
parent
0b58562a4e
commit
ec5d3e55c7
2 changed files with 5 additions and 6 deletions
|
@ -117,12 +117,11 @@ class User extends BaseDataTransferObject
|
|||
* @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;
|
||||
|
||||
|
@ -156,10 +155,10 @@ class User extends BaseDataTransferObject
|
|||
$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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue