entry = SeasonTicketContractEntry::find($recordNo); return; } else if ($recordNo instanceof SeasonTicketContractEntry) { $this->entry = $recordNo; return; } } public function getEntry() { return $this->entry; } public function cancel() { $this->entry->status = Status::CANCEL; return $this; } public function save() { $this->entry->save(); return $this; } public function getHash() { $source = sprintf("%010d-%s", $this->entry->getRecordId(), $this->entry->entryDatetime->format("YmdHi")); return hash('sha256', $source); } public function checkHash(string $hash): bool { $expect = $this->getHash(); return $expect === $hash; } }