\App\ModelsSysCache

缓存注册表项

职责:缓存治理的数据源——全部缓存 key 登记于此(替代原 config/cache-manager.php 注册表)。 name(逻辑名)是业务引用锚点不可改;key 模板可改(改后清旧实例自动重建,缓存值不丢); status 1=已审批 2=待审批(代码里 remember 未登记名时自动产生)。

Summary

Methods
Properties
Constants
timestampCasts()
$timestamps
$id
$name
$key
$layer
$ttl
$tables
$connection
$description
$status
$protected
$create_time
$update_time
STATUS_APPROVED
STATUS_PENDING
serializeDate()
casts()
boot()
$table
$fillable
N/A
No private methods found
No private properties found
N/A

Constants

STATUS_APPROVED

STATUS_APPROVED = 1

已审批(纳入正式治理)

STATUS_PENDING

STATUS_PENDING = 2

待审批(未登记自动产生,等待管理员审批)

Properties

$timestamps

$timestamps

$id

$id : int

主键ID

Type

int

$name

$name : string

逻辑名,锚点,不可改

Type

string

$key

$key : string

key 模板,{param} 占位

Type

string

$layer

$layer : string

分层:global/user/ttl/permanent

Type

string

$ttl

$ttl : int|null

TTL 秒

Type

int|null

$tables

$tables : array

依赖表

Type

array

$connection

$connection : string

Redis 连接:default/cache

Type

string

$description

$description : string

说明,审批必填

Type

string

$status

$status : int

状态:1 已审批、2 待审批

Type

int

$protected

$protected : int

保护锁:1 受保护,任何清理操作不删本缓存;0 不保护

Type

int

$create_time

$create_time : string

创建时间

Type

string

$update_time

$update_time : string|null

更新时间

┌────────────────── 分区导航(按此顺序阅读)──────────────────┐ 分区 1 · 常量 审批状态 STATUS_* 分区 2 · 表名与属性 $table / $fillable / casts 分区 3 · 模型启动钩子 boot(注册表变更 → 失效) └────────────────────────────────────────────────────────────┘

Type

string|null

$table

$table

$fillable

$fillable

Methods

timestampCasts()

timestampCasts() : array<string,string>

全库统一的时间列 cast 段(单源:约 22 个模型 casts() 内重复的两行)。 使用方模型 casts() 内 `return array_merge(self::timestampCasts(), [...])`。

Returns

array

serializeDate()

serializeDate(\DateTimeInterface  $date) : string

所有日期属性统一按 "年-月-日 时:分:秒" 序列化。

Parameters

\DateTimeInterface $date

Returns

string —

casts()

casts() : array

Returns

array —

boot()

boot() : void