tgbotlib/src/TgBotLib/Objects/BotShortDescription.php

47 lines
1,002 B
PHP
Raw Normal View History

<?php
2024-10-02 00:18:12 -04:00
namespace TgBotLib\Objects;
use TgBotLib\Interfaces\ObjectTypeInterface;
class BotShortDescription implements ObjectTypeInterface
{
2024-10-04 12:08:57 -04:00
private string $short_description;
/**
* The bot's short description
*
* @return string
*/
public function getShortDescription(): string
{
return $this->short_description;
}
/**
2024-10-04 12:08:57 -04:00
* @inheritDoc
*/
public function toArray(): array
{
return [
'short_description' => $this->short_description,
];
}
/**
2024-10-04 12:08:57 -04:00
* @inheritDoc
*/
2024-10-04 12:14:32 -04:00
public static function fromArray(?array $data): ?BotShortDescription
{
2024-10-04 12:14:32 -04:00
if($data === null)
{
return null;
}
2024-10-04 12:14:32 -04:00
$object = new self();
$object->short_description = $data['short_description'];
return $object;
}
}