Code Duplication    Length = 10-11 lines in 2 locations

class/adodb.php 1 location

@@ 1107-1117 (lines=11) @@
1104
			// Do prepare
1105
			$stmt = $this->Prepare($sql);
1106
			// Execute
1107
			if ('U' == $mode) {
1108
				foreach ($data as &$row) {
1109
					// Change pk's value position when update mode
1110
					foreach ($pk as $key) {
1111
						$v = $row[$key];
1112
						unset($row[$key]);
1113
						$row[$key] = $v;
1114
					}
1115
				}
1116
				unset($row);
1117
			}
1118
			// Now, finanly, actual write data
1119
			// Auto convert encoding ?
1120
			// Use of prepare we must convert $data manually, because $data is not sql.

src/Fwlib/Bridge/Adodb.php 1 location

@@ 1422-1431 (lines=10) @@
1419
        // @codeCoverageIgnoreEnd
1420
1421
        // Change PK position in data array
1422
        if ('U' == $mode) {
1423
            foreach ($data as &$row) {
1424
                foreach ($arPk as $key) {
1425
                    $v = $row[$key];
1426
                    unset($row[$key]);
1427
                    $row[$key] = $v;
1428
                }
1429
            }
1430
            unset($row);
1431
        }
1432
1433
        // Convert data encoding
1434
        $this->convertEncodingSql($data);