private function addInsertedRow($table, array $row, $id) { $primaryKey = $this->driver->getPrimaryKey($table); $primary = []; if ($primaryKey) { if ($id && count($primaryKey) === 1) { $primary[$primaryKey[0]] = $id; } else { foreach ($primaryKey as $column) { if (isset($row[$column])) { $primary[$column] = $row[$column]; } else { throw new \InvalidArgumentException('Primary key field ' . $column . ' is not set for table ' . $table); } } } } else { $primary = $row; } $this->insertedRows[] = ['table' => $table, 'primary' => $primary]; }