33namespace SilverStripe \Discoverer \Analytics ;
44
55use SilverStripe \Core \Injector \Injectable ;
6- use SilverStripe \View \ ViewableData ;
6+ use SilverStripe \Model \ ModelData ;
77
8- class AnalyticsData extends ViewableData
8+ class AnalyticsData extends ModelData
99{
1010
1111 use Injectable;
1212
13- private ?string $ engineName = null ;
13+ private ?string $ indexName = null ;
1414
1515 private ?string $ queryString = null ;
1616
1717 private mixed $ documentId = null ;
1818
1919 private mixed $ requestId = null ;
2020
21- public function getEngineName (): ?string
21+ public function getIndexName (): ?string
2222 {
23- return $ this ->engineName ;
23+ return $ this ->indexName ;
2424 }
2525
26- public function setEngineName (?string $ engineName ): AnalyticsData
26+ public function setIndexName (?string $ indexName ): AnalyticsData
2727 {
28- $ this ->engineName = $ engineName ;
28+ $ this ->indexName = $ indexName ;
2929
3030 return $ this ;
3131 }
@@ -66,17 +66,17 @@ public function setRequestId(mixed $requestId): AnalyticsData
6666 return $ this ;
6767 }
6868
69- public function forTemplate (): ? string
69+ public function forTemplate (): string
7070 {
7171 $ data = [];
7272
73- $ engineName = $ this ->getEngineName ();
73+ $ indexName = $ this ->getIndexName ();
7474 $ query = $ this ->getQueryString ();
7575 $ documentId = $ this ->getDocumentId ();
7676 $ requestId = $ this ->getRequestId ();
7777
78- if ($ engineName ) {
79- $ data ['engineName ' ] = $ engineName ;
78+ if ($ indexName ) {
79+ $ data ['indexName ' ] = $ indexName ;
8080 }
8181
8282 if ($ query ) {
@@ -92,7 +92,7 @@ public function forTemplate(): ?string
9292 }
9393
9494 if (!$ data ) {
95- return null ;
95+ return '' ;
9696 }
9797
9898 $ query = [
0 commit comments