tssTxId = $tssTxId; $this->errorMessage = $errorMessage; } /** * @param $apiResult * * @return static */ public static function fromApiResult(object $apiResult): self { return new self($apiResult->tss_tx_id ?? null, $apiResult->error_message ?? null); } /** * @param array $dbState * * @return static */ public static function fromDbState(array $dbState): self { return new self($dbState['tss_tx_id'] ?? null, $dbState['error_message'] ?? null); } /** * @return null[]|string[] */ public function toArray(): array { if($this->tssTxId !== null) { return ['tss_tx_id' => $this->getTssTxId()]; } return ['error_message' => $this->getErrorMessage()]; } /** * @return string|null */ public function getTssTxId(): ?string { return $this->tssTxId; } /** * @param string|null $tssTxId */ public function setTssTxId(?string $tssTxId): void { $this->tssTxId = $tssTxId; } /** * @return string|null */ public function getErrorMessage(): ?string { return $this->errorMessage; } /** * @param string|null $errorMessage */ public function setErrorMessage(?string $errorMessage): void { $this->errorMessage = $errorMessage; } }