getData('sync_type'); } /** @return array */ public function getRecord(): array { if ($this->record === null) { $this->record = $this->detailProvider->getRecord( $this->getSyncType(), (int)$this->getRequest()->getParam('id') ) ?? []; } return $this->record; } /** @return array> */ public function getLogs(): array { $record = $this->getRecord(); return $record === [] ? [] : $this->detailProvider->getLogs($this->getSyncType(), $record); } public function getBackUrl(): string { return $this->getUrl('esun_lingxing/' . $this->getSyncType() . '/index'); } public function prettyPayload(mixed $payload): string { if ($payload === null || $payload === '') { return (string)__('No data recorded.'); } if (is_string($payload)) { try { $decoded = json_decode($payload, true, 512, JSON_THROW_ON_ERROR); return (string)json_encode( $decoded, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_THROW_ON_ERROR ); } catch (\JsonException) { return $payload; } } try { return (string)json_encode( $payload, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_THROW_ON_ERROR ); } catch (\JsonException) { return (string)__('Unable to display data.'); } } }