Skip to content

Commit

Permalink
Do not skip column, if PK id was set, even for autoincrement keys (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
xaben authored Sep 19, 2023
1 parent 87ccd9b commit 2bbe9e9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions PDO/DataObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -2542,8 +2542,8 @@ function insert()

foreach($items as $k => $v) {

// if we are using autoincrement - skip the column...
if ($key && ($k == $key) && $useNative) {
// if we are using autoincrement - skip the column if it is empty...
if ($key && ($k == $key) && $useNative && empty($this->$k)) {
continue;

}
Expand Down

0 comments on commit 2bbe9e9

Please sign in to comment.