Bouncy Melons 0.2
declarative style orm
TimeField.php
Go to the documentation of this file.
1 <?php
2 
3 namespace bm;
4 
5 class TimeField extends Field {
6  const DEFAULT_SQL_TYPE = "time";
7 
8  public function beforeSet($value) {
9  return date('H:i:s',strtotime($value));
10  }
11 
12  public function beforeGet($value) {
13  $val = parent::beforeGet($value);
14  $format = $this->getOption('format');
15  if(empty($format)) {
16  $format = "H:i:s";
17  }
18  return date($format,strtotime($value));
19  }
20 }
beforeSet($value)
Definition: TimeField.php:8
beforeGet($value)
Definition: TimeField.php:12