| [ Index ] |
PHP Cross Reference of Limb3 |
[Summary view] [Print] [Text view]
1 <?php 2 /* 3 * Limb PHP Framework 4 * 5 * @link http://limb-project.com 6 * @copyright Copyright © 2004-2007 BIT(http://bit-creative.com) 7 * @license LGPL http://www.gnu.org/copyleft/lesser.html 8 */ 9 lmb_require('limb/dbal/src/drivers/lmbDbBaseRecord.class.php'); 10 11 /** 12 * class lmbPgsqlRecord. 13 * 14 * @package dbal 15 * @version $Id: lmbPgsqlRecord.class.php 5945 2007-06-06 08:31:43Z pachanga $ 16 */ 17 class lmbPgsqlRecord extends lmbDbBaseRecord 18 { 19 protected $properties = array(); 20 21 function __construct($data = array()) 22 { 23 $this->properties = $data; 24 } 25 26 function get($name) 27 { 28 if(isset($this->properties[$name])) 29 return $this->properties[$name]; 30 } 31 32 function set($name, $value) 33 { 34 $this->properties[$name] = $value; 35 } 36 37 function export() 38 { 39 return $this->properties; 40 } 41 42 function import($values) 43 { 44 $this->properties = $values; 45 } 46 47 function remove($name) 48 { 49 if(isset($this->properties[$name])) 50 unset($this->properties[$name]); 51 } 52 53 function has($name) 54 { 55 return isset($this->properties[$name]); 56 } 57 58 function reset() 59 { 60 $this->properties = array(); 61 } 62 63 function getInteger($name) 64 { 65 $value = $this->get($name); 66 return is_null($value) ? null : (int) $value; 67 } 68 69 function getFloat($name) 70 { 71 $value = $this->get($name); 72 return is_null($value) ? null : (float) $value; 73 } 74 75 function getString($name) 76 { 77 $value = $this->get($name); 78 return is_null($value) ? null : (string) $value; 79 } 80 81 function getBoolean($name) 82 { 83 $value = $this->get($name); 84 if(is_null($value)) 85 return null; 86 87 return $value == 't' ? true : false; 88 } 89 90 function getIntegerTimeStamp($name) 91 { 92 $value = $this->get($name); 93 if(is_integer($value)) 94 { 95 return $value; 96 } 97 else if(is_string($value)) 98 { 99 $ts = strtotime($value); 100 if($ts === -1) 101 { 102 if(preg_match('/([\d]{4})([\d]{2})([\d]{2})([\d]{2})([\d]{2})([\d]{2})/', $value, $matches)) 103 return mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]); 104 } 105 else 106 return $ts; 107 } 108 } 109 110 function _getDate($name, $format) 111 { 112 $value = $this->get($name); 113 if(is_integer($value)) 114 return date($format, $value); 115 else 116 return $value; 117 } 118 119 function getStringDate($name) 120 { 121 return $this->_getDate($name, 'Y-m-d'); 122 } 123 124 function getStringTime($name) 125 { 126 return $this->_getDate($name, 'H:i:s'); 127 } 128 129 function getStringTimeStamp($name) 130 { 131 return $this->_getDate($name, 'Y-m-d H:i:s'); 132 } 133 134 function getStringFixed($name) 135 { 136 $value = $this->get($name); 137 return is_null($value) ? null : (string) $value; 138 } 139 140 function getBlob($name) 141 { 142 $value = $this->get($name); 143 return is_null($value) ? null : pg_unescape_bytea($value); 144 } 145 146 function getClob($name) 147 { 148 return $this->get($name); 149 } 150 } 151 152 ?>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Sat Nov 22 03:48:54 2008 | Cross-referenced by PHPXref 0.7 |