00001 <?php 00002 namespace Habari; 00015 class XMLRPCDate 00016 { 00017 private $rpcdate; 00018 00019 public function __set( $name, $value ) 00020 { 00021 switch ( $name ) { 00022 case 'date': 00023 if ( is_numeric( $value ) ) { 00024 $this->rpcdate = $value; 00025 } 00026 else { 00027 $this->rpcdate = strtotime( $value ); 00028 } 00029 } 00030 } 00031 00032 public function __get( $name ) 00033 { 00034 switch ( $name ) { 00035 case 'date': 00036 return $this->rpcdate; 00037 } 00038 } 00039 00040 public function __construct( $date = null ) 00041 { 00042 if ( isset( $date ) ) { 00043 $this->date = $date; 00044 } 00045 } 00046 } 00047 00048 ?>