Skip to content

Commit 15d926e

Browse files
committed
Fix casts store for update
1 parent 1a781fc commit 15d926e

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/DataMapper/DataMapper.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,12 @@ protected function doUpdate($dataset, array $condFields, $updateNulls = false)
318318
$data = $this->bindData($data);
319319
}
320320

321+
// If data is entity object, try cast values first.
322+
if ($data instanceof Entity)
323+
{
324+
$data = $this->castForStore($data);
325+
}
326+
321327
$entity = new Entity($this->getFields($this->table), $data);
322328

323329
if ($updateNulls)

0 commit comments

Comments
 (0)