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.
42 lines
779 B
42 lines
779 B
|
2 days ago
|
<?php
|
||
|
|
|
||
|
|
namespace App\Support;
|
||
|
|
|
||
|
|
final class TeacherLibraryStatus
|
||
|
|
{
|
||
|
|
public const Pending = 'pending';
|
||
|
|
|
||
|
|
public const Active = 'active';
|
||
|
|
|
||
|
|
public const Rejected = 'rejected';
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @return array<string, string>
|
||
|
|
*/
|
||
|
|
public static function labels(): array
|
||
|
|
{
|
||
|
|
return [
|
||
|
|
self::Pending => '待确认',
|
||
|
|
self::Active => '已入库',
|
||
|
|
self::Rejected => '已驳回',
|
||
|
|
];
|
||
|
|
}
|
||
|
|
|
||
|
|
public static function label(?string $status): string
|
||
|
|
{
|
||
|
|
if (! $status) {
|
||
|
|
return '—';
|
||
|
|
}
|
||
|
|
|
||
|
|
return self::labels()[$status] ?? $status;
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @return list<string>
|
||
|
|
*/
|
||
|
|
public static function linkable(): array
|
||
|
|
{
|
||
|
|
return [self::Active, self::Pending];
|
||
|
|
}
|
||
|
|
}
|