00001 <?php 00002 00006 class spunQ_TimeType extends spunQ_BuiltinType { 00007 00012 private static $instance; 00013 00018 public static function &getInstance() { 00019 if (self::$instance === NULL) { 00020 self::$instance = new self(); 00021 } 00022 return self::$instance; 00023 } 00024 00031 public static function setInstance($instance) { 00032 self::$instance = $instance; 00033 return NULL; 00034 } 00035 00039 public function check($value, spunQ_Map $options = NULL, $throwException = true) { 00040 if ($value === NULL && $options !== NULL && $options->keyExists('optional')) { 00041 return true; 00042 } 00043 if ($value instanceof spunQ_Time) { 00044 return true; 00045 } 00046 if ($throwException) { 00047 throw new spunQ_IllegalValueException('WrongType', $this->getName(), spunQ_Type::getDescription($value)); 00048 } 00049 return false; 00050 } 00051 00052 } 00053
1.5.9