type === 'user'; } /** * 登录用户的 uuid;游客为 null。 */ public function userUid(): ?string { return $this->isUser() ? $this->id : null; } /** * 写库用的两列。 * * @return array{account_type: string, account_id: string} */ public function columns(): array { return ['account_type' => $this->type, 'account_id' => $this->id]; } /** * 同一账号的唯一字符串(advisory lock 之类需要一个键的地方用)。 */ public function key(): string { return $this->type.':'.$this->id; } }