Skip to content

Commit

Permalink
dbal mapper: do no try persist if there is nothing to persist
Browse files Browse the repository at this point in the history
fixes 96eebfb
  • Loading branch information
hrach committed Sep 29, 2016
1 parent 44d7e81 commit 765716d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Mapper/Dbal/DbalMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,10 @@ protected function processInsert(IEntity $entity, $data)

protected function processUpdate(IEntity $entity, $data, $primary)
{
if (empty($data)) {
return;
}

$args = ['UPDATE %table SET %set WHERE %and', $this->getTableName(), $data, $primary];
if ($this instanceof IPersistAutoupdateMapper) {
$this->processAutoupdate($entity, $args);
Expand Down

0 comments on commit 765716d

Please sign in to comment.