InlineQueryResult.php 1.34 KB
Newer Older
MBoretto's avatar
MBoretto committed
1
<?php
Jack'lul's avatar
Jack'lul committed
2
/**
MBoretto's avatar
MBoretto committed
3 4 5 6 7 8
 * This file is part of the TelegramBot package.
 *
 * (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
Jack'lul's avatar
Jack'lul committed
9 10
 */

MBoretto's avatar
MBoretto committed
11 12 13 14 15 16 17 18
namespace Longman\TelegramBot\Entities;

use Longman\TelegramBot\Exception\TelegramException;

class InlineQueryResult extends Entity
{
    protected $type;
    protected $id;
19 20
    protected $input_message_content;
    protected $reply_markup;
MBoretto's avatar
MBoretto committed
21

MBoretto's avatar
MBoretto committed
22 23 24 25 26
    /**
     * InlineQueryResult constructor.
     *
     * @param array $data
     */
MBoretto's avatar
MBoretto committed
27 28 29 30 31 32 33 34
    public function __construct(array $data)
    {
        $this->type = null;
        $this->id = isset($data['id']) ? $data['id'] : null;
        if (empty($this->id)) {
            throw new TelegramException('id is empty!');
        }

35 36
        $this->input_message_content = isset($data['input_message_content']) ? $data['input_message_content'] : null;
        $this->reply_markup = isset($data['reply_markup']) ? $data['reply_markup'] : null;
MBoretto's avatar
MBoretto committed
37 38 39 40 41 42
    }

    public function getType()
    {
        return $this->type;
    }
43

MBoretto's avatar
MBoretto committed
44 45 46 47
    public function getId()
    {
        return $this->id;
    }
48 49 50 51 52 53 54 55 56 57

    public function getInputMessageContent()
    {
        return $this->input_message_content;
    }

    public function getReplyMarkup()
    {
        return $this->reply_markup;
    }
MBoretto's avatar
MBoretto committed
58
}