@@ -114,16 +114,16 @@ public function getDatatableQueryBuilder()
114114 //-------------------------------------------------
115115
116116 /**
117- * Get response.
117+ * Get response data as array .
118118 *
119119 * @param bool $countAllResults
120120 * @param bool $outputWalkers
121121 * @param bool $fetchJoinCollection
122122 *
123- * @return JsonResponse
123+ * @return array
124124 * @throws Exception
125125 */
126- public function getResponse ($ countAllResults = true , $ outputWalkers = false , $ fetchJoinCollection = true )
126+ public function getData ($ countAllResults = true , $ outputWalkers = false , $ fetchJoinCollection = true )
127127 {
128128 if (null === $ this ->datatable ) {
129129 throw new Exception ('DatatableResponse::getResponse(): Set a Datatable class with setDatatable(). ' );
@@ -145,7 +145,22 @@ public function getResponse($countAllResults = true, $outputWalkers = false, $fe
145145 'recordsTotal ' => true === $ countAllResults ? (int ) $ this ->datatableQueryBuilder ->getCountAllResults () : 0 ,
146146 );
147147
148- return new JsonResponse (array_merge ($ outputHeader , $ formatter ->getOutput ()));
148+ return array_merge ($ outputHeader , $ formatter ->getOutput ());
149+ }
150+
151+ /**
152+ * Get response.
153+ *
154+ * @param bool $countAllResults
155+ * @param bool $outputWalkers
156+ * @param bool $fetchJoinCollection
157+ *
158+ * @return JsonResponse
159+ * @throws Exception
160+ */
161+ public function getResponse ($ countAllResults = true , $ outputWalkers = false , $ fetchJoinCollection = true )
162+ {
163+ return new JsonResponse ($ this ->getData ($ countAllResults , $ outputWalkers , $ fetchJoinCollection ));
149164 }
150165
151166 //-------------------------------------------------
0 commit comments