Files
zhamao-framework/src/ZM/Annotation/CQ/CQMetaEvent.php

54 lines
1.0 KiB
PHP
Raw Normal View History

2020-03-02 16:14:20 +08:00
<?php
declare(strict_types=1);
2020-03-02 16:14:20 +08:00
namespace ZM\Annotation\CQ;
use Attribute;
use Doctrine\Common\Annotations\Annotation\NamedArgumentConstructor;
2020-03-02 16:14:20 +08:00
use Doctrine\Common\Annotations\Annotation\Required;
use Doctrine\Common\Annotations\Annotation\Target;
use ZM\Annotation\AnnotationBase;
use ZM\Annotation\Interfaces\Level;
/**
* Class CQMetaEvent
* @Annotation
* @NamedArgumentConstructor()
2020-03-02 16:14:20 +08:00
* @Target("ALL")
*/
#[Attribute(Attribute::IS_REPEATABLE | Attribute::TARGET_ALL)]
2020-03-02 16:14:20 +08:00
class CQMetaEvent extends AnnotationBase implements Level
{
/**
* @var string
* @Required()
*/
public $meta_event_type;
2020-03-02 16:14:20 +08:00
/** @var int */
public $level = 20;
public function __construct($meta_event_type, $level = 20)
{
$this->meta_event_type = $meta_event_type;
$this->level = $level;
}
2020-03-02 16:14:20 +08:00
/**
2022-04-02 23:37:22 +08:00
* @return int 返回等级
2020-03-02 16:14:20 +08:00
*/
public function getLevel(): int
{
return $this->level;
}
2020-03-02 16:14:20 +08:00
/**
* @param int $level
*/
public function setLevel($level)
{
2020-03-02 16:14:20 +08:00
$this->level = $level;
}
}