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.
 
 
 

48 lines
816 B

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