id); } /** * 判断内镜信息是否有效 */ public function isValid(): bool { return !empty($this->id) && !empty($this->cardNo); } /** * 转换为数组 */ public function toArray(): array { return [ 'id' => $this->id, 'name' => $this->name, 'cardNo' => $this->cardNo, 'type' => $this->type, ]; } }