Skip to content

Commit

Permalink
Fix casts store for update
Browse files Browse the repository at this point in the history
  • Loading branch information
asika32764 committed Jun 25, 2017
1 parent 1a781fc commit 15d926e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/DataMapper/DataMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,12 @@ protected function doUpdate($dataset, array $condFields, $updateNulls = false)
$data = $this->bindData($data);
}

// If data is entity object, try cast values first.
if ($data instanceof Entity)
{
$data = $this->castForStore($data);
}

$entity = new Entity($this->getFields($this->table), $data);

if ($updateNulls)
Expand Down

0 comments on commit 15d926e

Please sign in to comment.