@@ -26,31 +26,31 @@ public function insertWithReturningPks(string $table, QueryInterface|array $colu
26
26
throw new NotSupportedException (__METHOD__ . '() is not supported by SQLite. ' );
27
27
}
28
28
29
- public function resetSequence (string $ tableName , int |string $ value = null ): string
29
+ public function resetSequence (string $ table , int |string $ value = null ): string
30
30
{
31
- $ table = $ this ->schema ->getTableSchema ($ tableName );
31
+ $ tableSchema = $ this ->schema ->getTableSchema ($ table );
32
32
33
- if ($ table === null ) {
34
- throw new InvalidArgumentException ("Table not found: ' $ tableName '. " );
33
+ if ($ tableSchema === null ) {
34
+ throw new InvalidArgumentException ("Table not found: ' $ table '. " );
35
35
}
36
36
37
- $ sequenceName = $ table ->getSequenceName ();
37
+ $ sequenceName = $ tableSchema ->getSequenceName ();
38
38
39
39
if ($ sequenceName === null ) {
40
- throw new InvalidArgumentException ("There is not sequence associated with table ' $ tableName '.' " );
40
+ throw new InvalidArgumentException ("There is not sequence associated with table ' $ table '.' " );
41
41
}
42
42
43
- $ tableName = $ this ->quoter ->quoteTableName ($ tableName );
43
+ $ tableName = $ this ->quoter ->quoteTableName ($ table );
44
44
45
45
if ($ value !== null ) {
46
46
$ value = "' " . ((int ) $ value - 1 ) . "' " ;
47
47
} else {
48
- $ pk = $ table ->getPrimaryKey ();
48
+ $ pk = $ tableSchema ->getPrimaryKey ();
49
49
$ key = $ this ->quoter ->quoteColumnName (reset ($ pk ));
50
50
$ value = '(SELECT MAX( ' . $ key . ') FROM ' . $ tableName . ') ' ;
51
51
}
52
52
53
- return 'UPDATE sqlite_sequence SET seq= ' . $ value . " WHERE name=' " . $ table ->getName () . "' " ;
53
+ return 'UPDATE sqlite_sequence SET seq= ' . $ value . " WHERE name=' " . $ tableSchema ->getName () . "' " ;
54
54
}
55
55
56
56
public function upsert (
0 commit comments