Added \TgBotLib\Objects > VideoChatEnded.php

This commit is contained in:
Netkas 2023-02-12 21:52:45 -05:00
parent 763eb0c03d
commit 223baa8fa1

View file

@ -0,0 +1,50 @@
<?php
namespace TgBotLib\Objects;
use TgBotLib\Interfaces\ObjectTypeInterface;
class VideoChatEnded implements ObjectTypeInterface
{
/**
* @var int
*/
private $duration;
/**
* Video chat duration in seconds
*
* @return int
*/
public function getDuration(): int
{
return $this->duration;
}
/**
* Returns an array representation of the object
*
* @return array
*/
public function toArray(): array
{
return [
'duration' => $this->duration,
];
}
/**
* Constructs object from an array representation
*
* @param array $data
* @return ObjectTypeInterface
*/
public static function fromArray(array $data): ObjectTypeInterface
{
$object = new self();
$object->duration = $data['duration'];
return $object;
}
}