Permalink
Browse files

Merge pull request #3871 from postalservice14/hotfix/3862

The method delete on the RowGateway now returns the affected rows
  • Loading branch information...
2 parents c5d8be8 + 1adb0dd commit 05e0e04a413368e26c5a7e27931eea9282bc72da @weierophinney weierophinney committed Mar 11, 2013
@@ -205,10 +205,13 @@ public function delete()
$statement = $this->sql->prepareStatementForSqlObject($this->sql->delete()->where($where));
$result = $statement->execute();
- if ($result->getAffectedRows() == 1) {
+ $affectedRows = $result->getAffectedRows();
+ if ($affectedRows == 1) {
// detach from database
$this->primaryKeyData = null;
}
+
+ return $affectedRows;
}
/**
@@ -208,6 +208,7 @@ public function testDelete()
$this->rowGateway->foo = 'bar';
$affectedRows = $this->rowGateway->delete();
$this->assertFalse($this->rowGateway->rowExistsInDatabase());
+ $this->assertEquals(1, $affectedRows);
}
/**

0 comments on commit 05e0e04

Please sign in to comment.