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