4 * Class that handles integer config values
7 * @http://www.projectpier.org/
9 class DateTimeConfigHandler
extends ConfigHandler
{
14 * @param string $control_name
17 function render($control_name) {
19 return pick_date_widget($control_name, $this->getValue(), $year - 10, $year +
10);
23 * Conver $value to raw value
25 * @param DateTimeValue $value
28 protected function phpToRaw($value) {
29 return $value instanceof DateTimeValue ?
$value->toMySQL() : EMPTY_DATETIME
;
33 * Convert raw value to php
35 * @param string $value
38 protected function rawToPhp($value) {
39 $from_value = trim($value) ?
$value : EMPTY_DATETIME
;
40 return DateTimeValueLib
::makeFromString($from_value);
43 } // DateTimeConfigHandler