From 399a4ae0aeb988efa9dca5cef73bbd0c6e262b30 Mon Sep 17 00:00:00 2001 From: "aleksey.klimenko28" Date: Tue, 9 Jul 2024 09:01:12 +0300 Subject: [PATCH] fix for php 8; --- php/EditableGrid.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/php/EditableGrid.php b/php/EditableGrid.php index 87fd99c..e1d18c6 100644 --- a/php/EditableGrid.php +++ b/php/EditableGrid.php @@ -149,7 +149,7 @@ public function getXML($rows=false, $customRowAttributes=false, $encodeCustomAtt // data $rootNode->appendChild($dataNode = $DOMDocument->createElement('data')); if ($rows) { - $fetchMethod = method_exists($rows, 'fetch') ? 'fetch' : (method_exists($rows, 'fetch_assoc') ? 'fetch_assoc' : (method_exists($rows, 'FetchRow') ? 'FetchRow' : NULL)); + $fetchMethod = NULL;//method_exists($rows, 'fetch') ? 'fetch' : (method_exists($rows, 'fetch_assoc') ? 'fetch_assoc' : (method_exists($rows, 'FetchRow') ? 'FetchRow' : NULL)); if (!$fetchMethod) foreach ($rows as $row) $dataNode->appendChild($this->getRowXML($DOMDocument, $row, $customRowAttributes, $encodeCustomAttributes)); else while ($row = call_user_func(array($rows, $fetchMethod))) $dataNode->appendChild($this->getRowXML($DOMDocument, $row, $customRowAttributes, $encodeCustomAttributes)); } @@ -220,7 +220,7 @@ public function getPOJO($rows=false, $customRowAttributes=false, $encodeCustomAt $results['data'] = array(); if ($rows) { - $fetchMethod = method_exists($rows, 'fetch') ? 'fetch' : (method_exists($rows, 'fetch_assoc') ? 'fetch_assoc' : (method_exists($rows, 'FetchRow') ? 'FetchRow' : NULL)); + $fetchMethod = NULL;//method_exists($rows, 'fetch') ? 'fetch' : (method_exists($rows, 'fetch_assoc') ? 'fetch_assoc' : (method_exists($rows, 'FetchRow') ? 'FetchRow' : NULL)); if (!$fetchMethod) foreach ($rows as $row) $results['data'][] = $this->getRowPOJO($row, $customRowAttributes, $encodeCustomAttributes); else while ($row = call_user_func(array($rows, $fetchMethod))) $results['data'][] = $this->getRowPOJO($row, $customRowAttributes, $encodeCustomAttributes); }