Bouncy Melons 0.2
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) {
13  if($value == 'on') {
14  $value = 1;
15  }
16  if(empty($value)) {
17  $value = 0;
18  }
19  return parent::beforeSet($value);
20  }
21 }
beforeSet($value)
Definition: BoolField.php:12