Notebook
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
816 B

2 years ago
<?php
namespace Plugins\Notebook\Enums;
use App\Enums\EnumStatusTrait;
use Sc\Util\HtmlElement\ElementType\AbstractHtmlElement;
/**
* 笔记本 : 模式
*/
enum NotebookEnumMode :int
{
use EnumStatusTrait;
/**
2 years ago
* 公开
2 years ago
*/
2 years ago
case Public = 1;
2 years ago
/**
2 years ago
* 私有
2 years ago
*/
2 years ago
case Private = 2;
2 years ago
/**
* 获取描述
*
* @return string
*/
public function getDes(): string
{
return match ($this) {
2 years ago
self::Public => '公开',
self::Private => '私有',
2 years ago
};
}
/**
* 转标签
*/
public function toTag():AbstractHtmlElement
{
return match ($this){
2 years ago
self::Public => $this->getTag('success', 'light'),
self::Private => $this->getTag('warning', 'light'),
2 years ago
};
}
}