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

53 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 CQBefore
* @Annotation
* @NamedArgumentConstructor()
2020-03-02 16:14:20 +08:00
* @Target("METHOD")
*/
#[Attribute(Attribute::IS_REPEATABLE | Attribute::TARGET_METHOD)]
2020-03-02 16:14:20 +08:00
class CQBefore extends AnnotationBase implements Level
{
/**
* @var string
* @Required()
*/
public $cq_event;
public $level = 20;
public function __construct($cq_event, $level = 20)
{
$this->cq_event = $cq_event;
$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
{
2020-03-02 16:14:20 +08:00
return $this->level;
}
/**
* @param mixed $level
*/
public function setLevel($level)
{
2020-03-02 16:14:20 +08:00
$this->level = $level;
}
}