Skip to content

Commit

Permalink
Boolean field set value fix
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonOkulov committed May 23, 2019
1 parent 197d6e5 commit 3bb15fd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Phact/Orm/Fields/BooleanField.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ public function attributePrepareValue($value)
return isset($value) ? (bool) $value : null;
}

public function setValue($value, $aliasConfig = null)
{
$value = $this->attributePrepareValue($value);
return parent::setValue($value, $aliasConfig);
}

public function dbPrepareValue($value)
{
return $value ? 1 : 0;
Expand Down

0 comments on commit 3bb15fd

Please sign in to comment.