Added \TgBotLib\Objects > VideoChatEnded.php
This commit is contained in:
parent
763eb0c03d
commit
223baa8fa1
1 changed files with 50 additions and 0 deletions
50
src/TgBotLib/Objects/VideoChatEnded.php
Normal file
50
src/TgBotLib/Objects/VideoChatEnded.php
Normal 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;
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Add table
Reference in a new issue