Skip to content

Commit a591a71

Browse files
committed
Fixed StatementInterface processing
1 parent bbfa871 commit a591a71

1 file changed

Lines changed: 7 additions & 9 deletions

File tree

src/RowGateway/AbstractRowGateway.php

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -133,16 +133,14 @@ public function save(): int
133133
$insert->values($this->data);
134134

135135
$statement = $this->sql->prepareStatementForSqlObject($insert);
136-
if ($statement instanceof StatementInterface) {
137-
$result = $statement->execute();
138-
if (($primaryKeyValue = $result->getGeneratedValue()) && count($this->primaryKeyColumn) === 1) {
139-
$this->primaryKeyData = [$this->primaryKeyColumn[0] => $primaryKeyValue];
140-
} else {
141-
$this->processPrimaryKeyData();
142-
}
143-
$rowsAffected = $result->getAffectedRows();
144-
unset($statement, $result);
136+
$result = $statement->execute();
137+
if (($primaryKeyValue = $result->getGeneratedValue()) && count($this->primaryKeyColumn) === 1) {
138+
$this->primaryKeyData = [$this->primaryKeyColumn[0] => $primaryKeyValue];
139+
} else {
140+
$this->processPrimaryKeyData();
145141
}
142+
$rowsAffected = $result->getAffectedRows();
143+
unset($statement, $result);
146144

147145
$where = [];
148146
foreach ($this->primaryKeyColumn as $pkColumn) {

0 commit comments

Comments
 (0)