<?php

/**
 * Class LiveForwardUrl
 * 转发流传输数据
 */
class LiveForwardUrl
{
    /**
     * @var转发流的状态 boolean类型
     */
    public $status = false;
    /**
     * @var转发流URL
     */
    public $url = "";

    /**
     * 将LiveForwardUrl对象序列化为JSON
     * @return string
     */
    public function toJson()
    {
        return json_encode($this);
    }

    /**
     * 从一个JSON对象当中解析为LiveForwardUrl对象
     * @param $json
     */
    public function fromJson($json_obj)
    {
        $this->status = $json_obj['status'];
        $this->url = $json_obj['url'];
    }
}