mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-03-17 20:54:52 +08:00
26 lines
541 B
PHP
26 lines
541 B
PHP
<?php
|
|
|
|
|
|
namespace ZM\Entity;
|
|
|
|
|
|
class CQObject
|
|
{
|
|
public $type;
|
|
public $params;
|
|
public $start;
|
|
public $end;
|
|
|
|
public function __construct($type = "", $params = [], $start = 0, $end = 0) {
|
|
if ($type !== "") {
|
|
$this->type = $type;
|
|
$this->params = $params;
|
|
$this->start = $start;
|
|
$this->end = $end;
|
|
}
|
|
}
|
|
|
|
public static function fromArray($arr): CQObject {
|
|
return new CQObject($arr["type"], $arr["params"] ?? [], $arr["start"], $arr["end"]);
|
|
}
|
|
} |