<?php


namespace common\util;

use JsonSerializable;

/**
 * Class DeriveObj
 * @package common\util
 * @property int $deriver_id
 */
class DeriveObj implements JsonSerializable
{
    /**
     * ID
     */
    private $deriver_id;

    /**
     * @return int
     */
    public function getDeriverId(): int
    {
        return $this->deriver_id;
    }

    /**
     * @param int $deriver_id
     */
    public function setDeriverId(int $deriver_id)
    {
        $this->deriver_id = $deriver_id;
    }

    public function __construct($deriver_id)
    {
        $this->deriver_id = $deriver_id;
    }

    /**
     * json_encode无法转化私有属性，需要使用jsonSerialize自定义转换私有的属性
     * @return array
     */
    public function jsonSerialize(): array
    {
        return [
            "deriver_id" => $this->deriver_id,
        ];
    }
}