Code Duplication    Length = 10-11 lines in 2 locations

class/adodb.php 1 location

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

src/Fwlib/Bridge/Adodb.php 1 location

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