Skip to content

Commit

Permalink
Extend DbFuncMapper
Browse files Browse the repository at this point in the history
  • Loading branch information
dragomano committed Dec 25, 2024
1 parent c1ff3da commit 864167e
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/Compat/DbFuncMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,24 @@ public function insert(
return Utils::$smcFunc['db_insert']($method, $table, $columns, $data, $keys, $returnmode);
}

public function insert_id(string $table, ?string $field = null, ?object $connection = null): int
{
return Utils::$smcFunc['db_insert_id']($table, $field, $connection);
}

public function num_rows(object $result): int
{
return Utils::$smcFunc['db_num_rows']($result);
}

public function transaction(string $type = 'commit'): bool
public function affected_rows(?object $connection = null): int
{
return Utils::$smcFunc['db_affected_rows']($connection);
}

public function transaction(string $type = 'commit', ?object $connection = null): bool
{
return Utils::$smcFunc['db_transaction']($type);
return Utils::$smcFunc['db_transaction']($type, $connection);
}

public function optimize_table(string $table): int|float
Expand Down

0 comments on commit 864167e

Please sign in to comment.