tgbotlib/src/TgBotLib/Objects/GiveawayCreated.php

45 lines
900 B
PHP
Raw Normal View History

2024-10-01 13:00:53 -04:00
<?php
2024-10-02 00:18:12 -04:00
namespace TgBotLib\Objects;
2024-10-01 13:00:53 -04:00
use TgBotLib\Interfaces\ObjectTypeInterface;
class GiveawayCreated implements ObjectTypeInterface
{
private int $prize_star_count;
/**
* Optional. The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only
*
* @return int
*/
public function getPrizeStarCount(): int
{
return $this->prize_star_count;
}
/**
* @inheritDoc
*/
public function toArray(): array
{
return [
'prize_star_count' => $this->prize_star_count
];
}
/**
* @inheritDoc
*/
2024-10-04 21:19:12 -04:00
public static function fromArray(?array $data): ?GiveawayCreated
2024-10-01 13:00:53 -04:00
{
2024-10-04 21:19:12 -04:00
if(!$data)
{
return null;
}
2024-10-01 13:00:53 -04:00
$object = new self();
$object->prize_star_count = $data['prize_star_count'];
return $object;
}
}