Compare commits

...

3 Commits

Author SHA1 Message Date
Clemens Schwaighofer
93cb7e0cab DB IO Adjustments for cursor set check and table exists check 2025-04-22 11:04:22 +09:00
Clemens Schwaighofer
7fbce6529b Merge branch 'development' of github-omc:TBWA-EGPlus-Japan/Client-Projects.php-core-libraries into development 2025-04-22 10:53:19 +09:00
Clemens Schwaighofer
6e086fe7b3 Add array helper for modifying key of a key value array 2025-04-22 10:52:13 +09:00
3 changed files with 12 additions and 9 deletions

View File

@@ -557,9 +557,9 @@ class ArrayHandler
* does not change order in array * does not change order in array
* *
* @param array<string|int,mixed> $in_array * @param array<string|int,mixed> $in_array
* @param string [default=''] $key_mod_prefix * @param string $key_mod_prefix [default=''] key prefix string
* @param string [default=''] $key_mod_suffix * @param string $key_mod_suffix [default=''] key suffix string
* @return array * @return array<string|int,mixed>
*/ */
public static function arrayModifyKey( public static function arrayModifyKey(
array $in_array, array $in_array,

View File

@@ -39,9 +39,9 @@ class ArrayIO extends \CoreLibs\DB\IO
{ {
// main calss variables // main calss variables
/** @var array<mixed> */ /** @var array<mixed> */
private array $table_array; // the array from the table to work on private array $table_array = []; // the array from the table to work on
/** @var string */ /** @var string */
private string $table_name; // the table_name private string $table_name = ''; // the table_name
/** @var string */ /** @var string */
private string $pk_name = ''; // the primary key from this table private string $pk_name = ''; // the primary key from this table
/** @var int|string|null */ /** @var int|string|null */
@@ -127,9 +127,9 @@ class ArrayIO extends \CoreLibs\DB\IO
public function getTableArray(bool $reset = false): array public function getTableArray(bool $reset = false): array
{ {
if (!$reset) { if (!$reset) {
return $this->table_array ?? []; return $this->table_array;
} }
$table_array = $this->table_array ?? []; $table_array = $this->table_array;
reset($table_array); reset($table_array);
return $table_array; return $table_array;
} }
@@ -194,7 +194,7 @@ class ArrayIO extends \CoreLibs\DB\IO
*/ */
public function getTableName(): string public function getTableName(): string
{ {
return $this->table_name ?? ''; return $this->table_name;
} }
/** /**

View File

@@ -2544,7 +2544,10 @@ class IO
} // only go if NO cursor exists } // only go if NO cursor exists
// if cursor exists ... // if cursor exists ...
if ($this->cursor_ext[$query_hash]['cursor']) { if (
$this->cursor_ext[$query_hash]['cursor'] instanceof \PgSql\Result ||
$this->cursor_ext[$query_hash]['cursor'] == 1
) {
if ($first_call === true) { if ($first_call === true) {
$this->cursor_ext[$query_hash]['log'][] = 'First call'; $this->cursor_ext[$query_hash]['log'][] = 'First call';
// count the rows returned (if select) // count the rows returned (if select)