🎉 Hello world
This commit is contained in:
94
bot/Request.php
Normal file
94
bot/Request.php
Normal file
@@ -0,0 +1,94 @@
|
||||
<?php
|
||||
|
||||
namespace Shikiryu\Bot;
|
||||
|
||||
class Request
|
||||
{
|
||||
protected $token;
|
||||
protected $user_id;
|
||||
protected $username;
|
||||
protected $post_id;
|
||||
protected $timestamp;
|
||||
protected $text;
|
||||
|
||||
/**
|
||||
* Request constructor.
|
||||
* @param array $data
|
||||
*/
|
||||
public function __construct(array $data)
|
||||
{
|
||||
if (isset($data['token'])) {
|
||||
$this->token = $data['token'];
|
||||
}
|
||||
|
||||
if (isset($data['user_id'])) {
|
||||
$this->user_id = $data['user_id'];
|
||||
}
|
||||
|
||||
if (isset($data['username'])) {
|
||||
$this->username = $data['username'];
|
||||
}
|
||||
|
||||
if (isset($data['post_id'])) {
|
||||
$this->post_id = $data['post_id'];
|
||||
}
|
||||
|
||||
if (isset($data['timestamp'])) {
|
||||
$this->timestamp = $data['timestamp'];
|
||||
}
|
||||
|
||||
if (isset($data['text'])) {
|
||||
$this->text = $data['text'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getToken()
|
||||
{
|
||||
return $this->token;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getUserId()
|
||||
{
|
||||
return $this->user_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getUsername()
|
||||
{
|
||||
return $this->username;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getPostId()
|
||||
{
|
||||
return $this->post_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getTimestamp()
|
||||
{
|
||||
return $this->timestamp;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getText()
|
||||
{
|
||||
return $this->text;
|
||||
}
|
||||
|
||||
|
||||
}
|
Reference in New Issue
Block a user