Updated VideoChatParticipantsInvited
This commit is contained in:
parent
9a58bf51f4
commit
40816a586f
1 changed files with 23 additions and 10 deletions
|
@ -10,34 +10,47 @@
|
||||||
/**
|
/**
|
||||||
* @var User[]
|
* @var User[]
|
||||||
*/
|
*/
|
||||||
private $users;
|
private array $users;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns an array representation of the object
|
* New members that were invited to the video chat
|
||||||
*
|
*
|
||||||
* @return array
|
* @return User[]
|
||||||
|
*/
|
||||||
|
public function getUsers(): array
|
||||||
|
{
|
||||||
|
return $this->users;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
public function toArray(): array
|
public function toArray(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'users' => array_map(function (User $user) {
|
'users' => array_map(function (User $user)
|
||||||
|
{
|
||||||
return $user->toArray();
|
return $user->toArray();
|
||||||
}, $this->users),
|
}, $this->users),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs object from an array representation
|
* @inheritDoc
|
||||||
*
|
|
||||||
* @param array $data
|
|
||||||
* @return VideoChatParticipantsInvited
|
|
||||||
*/
|
*/
|
||||||
public static function fromArray(array $data): self
|
public static function fromArray(?array $data): ?VideoChatParticipantsInvited
|
||||||
{
|
{
|
||||||
|
if($data === null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
$object = new self();
|
$object = new self();
|
||||||
$object->users = array_map(function (array $user) {
|
$object->users = array_map(function (array $user)
|
||||||
|
{
|
||||||
return User::fromArray($user);
|
return User::fromArray($user);
|
||||||
}, $data['users']);
|
}, $data['users']);
|
||||||
|
|
||||||
return $object;
|
return $object;
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue