format($format) : NULL; } else { return date($format, strtotime($time)); } } /** * Converts value to boolean. * @param string key * @return mixed */ public function asBool($key) { $value = $this[$key]; if ($value === NULL || $value === FALSE) { return $value; } else { return ((bool) $value) && $value !== 'f' && $value !== 'F'; } } /** * PHP < 5.3 workaround * @return void */ public function __wakeup() { $this->setFlags(2); } }