Updated ForumTopic

This commit is contained in:
netkas 2024-10-04 21:12:50 -04:00
parent d386d1a553
commit c1eec26a2c

View file

@ -7,25 +7,10 @@
class ForumTopic implements ObjectTypeInterface class ForumTopic implements ObjectTypeInterface
{ {
/** private int $message_thread_id;
* @var int private string $name;
*/ private int $icon_color;
private $message_thread_id; private ?string $icon_custom_emoji_id;
/**
* @var string
*/
private $name;
/**
* @var int
*/
private $icon_color;
/**
* @var string|null
*/
private $icon_custom_emoji_id;
/** /**
* Unique identifier of the forum topic * Unique identifier of the forum topic
@ -68,9 +53,7 @@
} }
/** /**
* Returns an array representation of the object * @inheritDoc
*
* @return array
*/ */
public function toArray(): array public function toArray(): array
{ {
@ -83,15 +66,16 @@
} }
/** /**
* Constructs object from an array representation * @inheritDoc
*
* @param array $data
* @return ForumTopic
*/ */
public static function fromArray(array $data): self public static function fromArray(?array $data): ?ForumTopic
{ {
$object = new self(); if($data === null)
{
return null;
}
$object = new self();
$object->message_thread_id = $data['message_thread_id'] ?? null; $object->message_thread_id = $data['message_thread_id'] ?? null;
$object->name = $data['name'] ?? null; $object->name = $data['name'] ?? null;
$object->icon_color = $data['icon_color'] ?? null; $object->icon_color = $data['icon_color'] ?? null;