Bouncy Melons 0.1
declarative style orm
BoolField.php
Go to the documentation of this file.
1 <?php
2 
3 namespace bm;
4 
8 class BoolField extends Field {
9 
10  const DEFAULT_SQL_TYPE = "int(1)";
11 
12  public function beforeSet($value, ISingle $single) {
13  if($value == 'on') {
14  $value = true;
15  }
16  if(empty($value)) {
17  $value = false;
18  }
19  return parent::beforeSet($value, $single);
20  }
21 }
beforeSet($value, ISingle $single)
Definition: BoolField.php:12