@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | */ |
| 30 | 30 | public function __construct($object) |
| 31 | 31 | { |
| 32 | - $this->_key = $this->generateKey(serialize($object)); |
|
| 32 | + $this->_key=$this->generateKey(serialize($object)); |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | /** |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | */ |
| 39 | 39 | protected function generateKey($string) |
| 40 | 40 | { |
| 41 | - return sprintf('%x',crc32($string)); |
|
| 41 | + return sprintf('%x', crc32($string)); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | /** |
@@ -37,18 +37,18 @@ discard block |
||
| 37 | 37 | class TSqlMapCacheModel extends \Prado\TComponent |
| 38 | 38 | { |
| 39 | 39 | private $_cache; |
| 40 | - private $_hits = 0; |
|
| 41 | - private $_requests = 0; |
|
| 40 | + private $_hits=0; |
|
| 41 | + private $_requests=0; |
|
| 42 | 42 | private $_id; |
| 43 | 43 | private $_implementation=TSqlMapCacheTypes::Basic; |
| 44 | - private $_properties = array(); |
|
| 45 | - private $_flushInterval = 0; |
|
| 44 | + private $_properties=array(); |
|
| 45 | + private $_flushInterval=0; |
|
| 46 | 46 | |
| 47 | - private static $_cacheTypes = array(); |
|
| 47 | + private static $_cacheTypes=array(); |
|
| 48 | 48 | |
| 49 | 49 | public static function registerCacheType($type, $className) |
| 50 | 50 | { |
| 51 | - self::$_cacheTypes[$type] = $className; |
|
| 51 | + self::$_cacheTypes[$type]=$className; |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | /** |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | */ |
| 65 | 65 | public function setID($value) |
| 66 | 66 | { |
| 67 | - $this->_id = $value; |
|
| 67 | + $this->_id=$value; |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | /** |
@@ -80,10 +80,10 @@ discard block |
||
| 80 | 80 | */ |
| 81 | 81 | public function setImplementation($value) |
| 82 | 82 | { |
| 83 | - if (isset(self::$_cacheTypes[$value])) |
|
| 84 | - $this->_implementation = $value; |
|
| 83 | + if(isset(self::$_cacheTypes[$value])) |
|
| 84 | + $this->_implementation=$value; |
|
| 85 | 85 | else |
| 86 | - $this->_implementation = TPropertyValue::ensureEnum($value,'Prado\\Data\\SqlMap\\Configuration\\TSqlMapCacheTypes'); |
|
| 86 | + $this->_implementation=TPropertyValue::ensureEnum($value, 'Prado\\Data\\SqlMap\\Configuration\\TSqlMapCacheTypes'); |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | /** |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | public function initialize($cache=null) |
| 110 | 110 | { |
| 111 | 111 | if($cache===null) |
| 112 | - $this->_cache= Prado::createComponent($this->getImplementationClass(), $this); |
|
| 112 | + $this->_cache=Prado::createComponent($this->getImplementationClass(), $this); |
|
| 113 | 113 | else |
| 114 | 114 | $this->_cache=$cache; |
| 115 | 115 | } |
@@ -119,10 +119,10 @@ discard block |
||
| 119 | 119 | */ |
| 120 | 120 | public function getImplementationClass() |
| 121 | 121 | { |
| 122 | - $implementation = $this->_implementation; |
|
| 123 | - if (isset(self::$_cacheTypes[$implementation])) return self::$_cacheTypes[$implementation]; |
|
| 122 | + $implementation=$this->_implementation; |
|
| 123 | + if(isset(self::$_cacheTypes[$implementation])) return self::$_cacheTypes[$implementation]; |
|
| 124 | 124 | |
| 125 | - switch(TPropertyValue::ensureEnum($implementation,'Prado\\Data\\SqlMap\\Configuration\\TSqlMapCacheTypes')) |
|
| 125 | + switch(TPropertyValue::ensureEnum($implementation, 'Prado\\Data\\SqlMap\\Configuration\\TSqlMapCacheTypes')) |
|
| 126 | 126 | { |
| 127 | 127 | case TSqlMapCacheTypes::FIFO: return '\\Prado\\Data\\SqlMap\\DataMapper\\TSqlMapFifoCache'; |
| 128 | 128 | case TSqlMapCacheTypes::LRU : return '\\Prado\\Data\\SqlMap\\DataMapper\\TSqlMapLruCache'; |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | */ |
| 137 | 137 | public function registerTriggerStatement($mappedStatement) |
| 138 | 138 | { |
| 139 | - $mappedStatement->attachEventHandler('OnExecuteQuery',array($this, 'flush')); |
|
| 139 | + $mappedStatement->attachEventHandler('OnExecuteQuery', array($this, 'flush')); |
|
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | /** |
@@ -154,10 +154,10 @@ discard block |
||
| 154 | 154 | public function get($key) |
| 155 | 155 | { |
| 156 | 156 | if($key instanceof TSqlMapCacheKey) |
| 157 | - $key = $key->getHash(); |
|
| 157 | + $key=$key->getHash(); |
|
| 158 | 158 | |
| 159 | 159 | //if flush ? |
| 160 | - $value = $this->_cache->get($key); |
|
| 160 | + $value=$this->_cache->get($key); |
|
| 161 | 161 | $this->_requests++; |
| 162 | 162 | if($value!==null) |
| 163 | 163 | $this->_hits++; |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | public function set($key, $value) |
| 172 | 172 | { |
| 173 | 173 | if($key instanceof TSqlMapCacheKey) |
| 174 | - $key = $key->getHash(); |
|
| 174 | + $key=$key->getHash(); |
|
| 175 | 175 | |
| 176 | 176 | if($value!==null) |
| 177 | 177 | $this->_cache->set($key, $value, $this->_flushInterval); |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | */ |
| 183 | 183 | public function getHitRatio() |
| 184 | 184 | { |
| 185 | - if($this->_requests != 0) |
|
| 185 | + if($this->_requests!=0) |
|
| 186 | 186 | return $this->_hits / $this->_requests; |
| 187 | 187 | else |
| 188 | 188 | return 0; |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | */ |
| 53 | 53 | public function setColumn($value) |
| 54 | 54 | { |
| 55 | - $this->_column = $value; |
|
| 55 | + $this->_column=$value; |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | /** |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | */ |
| 73 | 73 | public function setType($value) |
| 74 | 74 | { |
| 75 | - $this->_type = $value; |
|
| 75 | + $this->_type=$value; |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | /** |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | */ |
| 89 | 89 | public function setTypeHandler($value) |
| 90 | 90 | { |
| 91 | - $this->_typeHandler = $value; |
|
| 91 | + $this->_typeHandler=$value; |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | /** |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | */ |
| 107 | 107 | public function setColumnIndex($value) |
| 108 | 108 | { |
| 109 | - $this->_columnIndex = TPropertyValue::ensureInteger($value); |
|
| 109 | + $this->_columnIndex=TPropertyValue::ensureInteger($value); |
|
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | /** |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | */ |
| 123 | 123 | public function setNullValue($value) |
| 124 | 124 | { |
| 125 | - $this->_nullValue = $value; |
|
| 125 | + $this->_nullValue=$value; |
|
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | /** |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | */ |
| 139 | 139 | public function addSubMap($subMap) |
| 140 | 140 | { |
| 141 | - $this->_subMaps[] = $subMap; |
|
| 141 | + $this->_subMaps[]=$subMap; |
|
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | /** |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | */ |
| 158 | 158 | public function initMapping($resultMap) |
| 159 | 159 | { |
| 160 | - $this->_mapping = new TResultProperty($resultMap); |
|
| 160 | + $this->_mapping=new TResultProperty($resultMap); |
|
| 161 | 161 | $this->_mapping->setColumn($this->getColumn()); |
| 162 | 162 | $this->_mapping->setColumnIndex($this->getColumnIndex()); |
| 163 | 163 | $this->_mapping->setType($this->getType()); |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | { |
| 174 | 174 | foreach($this->_subMaps as $subMap) |
| 175 | 175 | { |
| 176 | - $this->_resultMaps[$subMap->getValue()] = |
|
| 176 | + $this->_resultMaps[$subMap->getValue()]= |
|
| 177 | 177 | $manager->getResultMap($subMap->getResultMapping()); |
| 178 | 178 | } |
| 179 | 179 | } |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | public function configure($filename=null) |
| 62 | 62 | { |
| 63 | 63 | $this->_configFile=$filename; |
| 64 | - $document = $this->loadXmlDocument($filename,$this); |
|
| 64 | + $document=$this->loadXmlDocument($filename, $this); |
|
| 65 | 65 | |
| 66 | 66 | foreach($document->xpath('//property') as $property) |
| 67 | 67 | $this->loadGlobalProperty($property); |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | $this->loadDatabaseConnection($conn); |
| 74 | 74 | |
| 75 | 75 | //try to load configuration in the current config file. |
| 76 | - $mapping = new TSqlMapXmlMappingConfiguration($this); |
|
| 76 | + $mapping=new TSqlMapXmlMappingConfiguration($this); |
|
| 77 | 77 | $mapping->configure($filename); |
| 78 | 78 | |
| 79 | 79 | foreach($document->xpath('//sqlMap') as $sqlmap) |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | */ |
| 90 | 90 | protected function loadGlobalProperty($node) |
| 91 | 91 | { |
| 92 | - $this->_properties[(string)$node['name']] = (string)$node['value']; |
|
| 92 | + $this->_properties[(string) $node['name']]=(string) $node['value']; |
|
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | /** |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | */ |
| 99 | 99 | protected function loadTypeHandler($node) |
| 100 | 100 | { |
| 101 | - $handler = $this->createObjectFromNode($node); |
|
| 101 | + $handler=$this->createObjectFromNode($node); |
|
| 102 | 102 | $this->_manager->getTypeHandlers()->registerTypeHandler($handler); |
| 103 | 103 | } |
| 104 | 104 | |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | */ |
| 109 | 109 | protected function loadDatabaseConnection($node) |
| 110 | 110 | { |
| 111 | - $conn = $this->createObjectFromNode($node); |
|
| 111 | + $conn=$this->createObjectFromNode($node); |
|
| 112 | 112 | $this->_manager->setDbConnection($conn); |
| 113 | 113 | } |
| 114 | 114 | |
@@ -118,13 +118,13 @@ discard block |
||
| 118 | 118 | */ |
| 119 | 119 | protected function loadSqlMappingFiles($node) |
| 120 | 120 | { |
| 121 | - if(strlen($resource = (string)$node['resource']) > 0) |
|
| 121 | + if(strlen($resource=(string) $node['resource']) > 0) |
|
| 122 | 122 | { |
| 123 | - if( strpos($resource, '${') !== false) |
|
| 124 | - $resource = $this->replaceProperties($resource); |
|
| 123 | + if(strpos($resource, '${')!==false) |
|
| 124 | + $resource=$this->replaceProperties($resource); |
|
| 125 | 125 | |
| 126 | - $mapping = new TSqlMapXmlMappingConfiguration($this); |
|
| 127 | - $filename = $this->getAbsoluteFilePath($this->_configFile, $resource); |
|
| 126 | + $mapping=new TSqlMapXmlMappingConfiguration($this); |
|
| 127 | + $filename=$this->getAbsoluteFilePath($this->_configFile, $resource); |
|
| 128 | 128 | $mapping->configure($filename); |
| 129 | 129 | } |
| 130 | 130 | } |
@@ -134,12 +134,12 @@ discard block |
||
| 134 | 134 | */ |
| 135 | 135 | protected function resolveResultMapping() |
| 136 | 136 | { |
| 137 | - $maps = $this->_manager->getResultMaps(); |
|
| 137 | + $maps=$this->_manager->getResultMaps(); |
|
| 138 | 138 | foreach($maps as $entry) |
| 139 | 139 | { |
| 140 | 140 | foreach($entry->getColumns() as $item) |
| 141 | 141 | { |
| 142 | - $resultMap = $item->getResultMapping(); |
|
| 142 | + $resultMap=$item->getResultMapping(); |
|
| 143 | 143 | if(strlen($resultMap) > 0) |
| 144 | 144 | { |
| 145 | 145 | if($maps->contains($resultMap)) |
@@ -162,9 +162,9 @@ discard block |
||
| 162 | 162 | { |
| 163 | 163 | foreach($this->_manager->getMappedStatements() as $mappedStatement) |
| 164 | 164 | { |
| 165 | - if(strlen($model = $mappedStatement->getStatement()->getCacheModel()) > 0) |
|
| 165 | + if(strlen($model=$mappedStatement->getStatement()->getCacheModel()) > 0) |
|
| 166 | 166 | { |
| 167 | - $cache = $this->_manager->getCacheModel($model); |
|
| 167 | + $cache=$this->_manager->getCacheModel($model); |
|
| 168 | 168 | $mappedStatement->getStatement()->setCache($cache); |
| 169 | 169 | } |
| 170 | 170 | } |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | public function replaceProperties($string) |
| 180 | 180 | { |
| 181 | 181 | foreach($this->_properties as $find => $replace) |
| 182 | - $string = str_replace('${'.$find.'}', $replace, $string); |
|
| 182 | + $string=str_replace('${'.$find.'}', $replace, $string); |
|
| 183 | 183 | return $string; |
| 184 | 184 | } |
| 185 | 185 | } |
| 186 | 186 | \ No newline at end of file |
@@ -23,6 +23,6 @@ |
||
| 23 | 23 | { |
| 24 | 24 | private $_generate; |
| 25 | 25 | |
| 26 | - public function getGenerate(){ return $this->_generate; } |
|
| 27 | - public function setGenerate($value){ $this->_generate = $value; } |
|
| 26 | + public function getGenerate() { return $this->_generate; } |
|
| 27 | + public function setGenerate($value) { $this->_generate=$value; } |
|
| 28 | 28 | } |
| 29 | 29 | \ No newline at end of file |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | */ |
| 76 | 76 | public function setParameterMap($value) |
| 77 | 77 | { |
| 78 | - $this->_parameterMapName = $value; |
|
| 78 | + $this->_parameterMapName=$value; |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | /** |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | */ |
| 95 | 95 | public function setParameterClass($value) |
| 96 | 96 | { |
| 97 | - $this->_parameterClassName = $value; |
|
| 97 | + $this->_parameterClassName=$value; |
|
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | /** |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | */ |
| 113 | 113 | public function setResultMap($value) |
| 114 | 114 | { |
| 115 | - $this->_resultMapName = $value; |
|
| 115 | + $this->_resultMapName=$value; |
|
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | /** |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | */ |
| 134 | 134 | public function setResultClass($value) |
| 135 | 135 | { |
| 136 | - $this->_resultClassName = $value; |
|
| 136 | + $this->_resultClassName=$value; |
|
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | /** |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | */ |
| 150 | 150 | public function setCacheModel($value) |
| 151 | 151 | { |
| 152 | - $this->_cacheModelName = $value; |
|
| 152 | + $this->_cacheModelName=$value; |
|
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | /** |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | */ |
| 166 | 166 | public function setCache($value) |
| 167 | 167 | { |
| 168 | - $this->_cache = $value; |
|
| 168 | + $this->_cache=$value; |
|
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | /** |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | */ |
| 182 | 182 | public function setSqlText($value) |
| 183 | 183 | { |
| 184 | - $this->_SQL = $value; |
|
| 184 | + $this->_SQL=$value; |
|
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | /** |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | */ |
| 199 | 199 | public function setListClass($value) |
| 200 | 200 | { |
| 201 | - $this->_listClass = $value; |
|
| 201 | + $this->_listClass=$value; |
|
| 202 | 202 | } |
| 203 | 203 | |
| 204 | 204 | /** |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | */ |
| 215 | 215 | public function setExtends($value) |
| 216 | 216 | { |
| 217 | - $this->_extendStatement = $value; |
|
| 217 | + $this->_extendStatement=$value; |
|
| 218 | 218 | } |
| 219 | 219 | |
| 220 | 220 | /** |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | */ |
| 241 | 241 | public function setInlineParameterMap($map) |
| 242 | 242 | { |
| 243 | - $this->_parameterMap = $map; |
|
| 243 | + $this->_parameterMap=$map; |
|
| 244 | 244 | } |
| 245 | 245 | |
| 246 | 246 | /** |
@@ -249,9 +249,9 @@ discard block |
||
| 249 | 249 | public function initialize($manager) |
| 250 | 250 | { |
| 251 | 251 | if(strlen($this->_resultMapName) > 0) |
| 252 | - $this->_resultMap = $manager->getResultMap($this->_resultMapName); |
|
| 252 | + $this->_resultMap=$manager->getResultMap($this->_resultMapName); |
|
| 253 | 253 | if(strlen($this->_parameterMapName) > 0) |
| 254 | - $this->_parameterMap = $manager->getParameterMap($this->_parameterMapName); |
|
| 254 | + $this->_parameterMap=$manager->getParameterMap($this->_parameterMapName); |
|
| 255 | 255 | } |
| 256 | 256 | |
| 257 | 257 | /** |
@@ -260,8 +260,8 @@ discard block |
||
| 260 | 260 | */ |
| 261 | 261 | public function createInstanceOfListClass($registry) |
| 262 | 262 | { |
| 263 | - if(strlen($type = $this->getListClass()) > 0) |
|
| 264 | - return $this->createInstanceOf($registry,$type); |
|
| 263 | + if(strlen($type=$this->getListClass()) > 0) |
|
| 264 | + return $this->createInstanceOf($registry, $type); |
|
| 265 | 265 | return array(); |
| 266 | 266 | } |
| 267 | 267 | |
@@ -272,9 +272,9 @@ discard block |
||
| 272 | 272 | * @param array result data. |
| 273 | 273 | * @return mixed result object. |
| 274 | 274 | */ |
| 275 | - protected function createInstanceOf($registry,$type,$row=null) |
|
| 275 | + protected function createInstanceOf($registry, $type, $row=null) |
|
| 276 | 276 | { |
| 277 | - $handler = $registry->getTypeHandler($type); |
|
| 277 | + $handler=$registry->getTypeHandler($type); |
|
| 278 | 278 | if($handler!==null) |
| 279 | 279 | return $handler->createNewInstance($row); |
| 280 | 280 | else |
@@ -287,30 +287,30 @@ discard block |
||
| 287 | 287 | * @param array result data. |
| 288 | 288 | * @return mixed result object. |
| 289 | 289 | */ |
| 290 | - public function createInstanceOfResultClass($registry,$row) |
|
| 290 | + public function createInstanceOfResultClass($registry, $row) |
|
| 291 | 291 | { |
| 292 | - if(strlen($type= $this->getResultClass()) > 0) |
|
| 293 | - return $this->createInstanceOf($registry,$type,$row); |
|
| 292 | + if(strlen($type=$this->getResultClass()) > 0) |
|
| 293 | + return $this->createInstanceOf($registry, $type, $row); |
|
| 294 | 294 | } |
| 295 | 295 | |
| 296 | 296 | public function __sleep() |
| 297 | 297 | { |
| 298 | - $cn = __CLASS__; |
|
| 299 | - $exprops = array("\0$cn\0_resultMap"); |
|
| 300 | - if (!$this->_parameterMapName) $exprops[] = "\0$cn\0_parameterMapName"; |
|
| 301 | - if (!$this->_parameterMap) $exprops[] = "\0$cn\0_parameterMap"; |
|
| 302 | - if (!$this->_parameterClassName) $exprops[] = "\0$cn\0_parameterClassName"; |
|
| 303 | - if (!$this->_resultMapName) $exprops[] = "\0$cn\0_resultMapName"; |
|
| 304 | - if (!$this->_resultMap) $exprops[] = "\0$cn\0_resultMap"; |
|
| 305 | - if (!$this->_resultClassName) $exprops[] = "\0$cn\0_resultClassName"; |
|
| 306 | - if (!$this->_cacheModelName) $exprops[] = "\0$cn\0_cacheModelName"; |
|
| 307 | - if (!$this->_SQL) $exprops[] = "\0$cn\0_SQL"; |
|
| 308 | - if (!$this->_listClass) $exprops[] = "\0$cn\0_listClass"; |
|
| 309 | - if (!$this->_typeHandler) $exprops[] = "\0$cn\0_typeHandler"; |
|
| 310 | - if (!$this->_extendStatement) $exprops[] = "\0$cn\0_extendStatement"; |
|
| 311 | - if (!$this->_cache) $exprops[] = "\0$cn\0_cache"; |
|
| 312 | - |
|
| 313 | - return array_diff(parent::__sleep(),$exprops); |
|
| 298 | + $cn=__CLASS__; |
|
| 299 | + $exprops=array("\0$cn\0_resultMap"); |
|
| 300 | + if(!$this->_parameterMapName) $exprops[]="\0$cn\0_parameterMapName"; |
|
| 301 | + if(!$this->_parameterMap) $exprops[]="\0$cn\0_parameterMap"; |
|
| 302 | + if(!$this->_parameterClassName) $exprops[]="\0$cn\0_parameterClassName"; |
|
| 303 | + if(!$this->_resultMapName) $exprops[]="\0$cn\0_resultMapName"; |
|
| 304 | + if(!$this->_resultMap) $exprops[]="\0$cn\0_resultMap"; |
|
| 305 | + if(!$this->_resultClassName) $exprops[]="\0$cn\0_resultClassName"; |
|
| 306 | + if(!$this->_cacheModelName) $exprops[]="\0$cn\0_cacheModelName"; |
|
| 307 | + if(!$this->_SQL) $exprops[]="\0$cn\0_SQL"; |
|
| 308 | + if(!$this->_listClass) $exprops[]="\0$cn\0_listClass"; |
|
| 309 | + if(!$this->_typeHandler) $exprops[]="\0$cn\0_typeHandler"; |
|
| 310 | + if(!$this->_extendStatement) $exprops[]="\0$cn\0_extendStatement"; |
|
| 311 | + if(!$this->_cache) $exprops[]="\0$cn\0_cache"; |
|
| 312 | + |
|
| 313 | + return array_diff(parent::__sleep(), $exprops); |
|
| 314 | 314 | } |
| 315 | 315 | |
| 316 | 316 | } |
| 317 | 317 | \ No newline at end of file |
@@ -39,6 +39,6 @@ |
||
| 39 | 39 | */ |
| 40 | 40 | public function setSelectKey($value) |
| 41 | 41 | { |
| 42 | - $this->_selectKey = $value; |
|
| 42 | + $this->_selectKey=$value; |
|
| 43 | 43 | } |
| 44 | 44 | } |
| 45 | 45 | \ No newline at end of file |
@@ -33,8 +33,8 @@ discard block |
||
| 33 | 33 | { |
| 34 | 34 | if(isset($node['class'])) |
| 35 | 35 | { |
| 36 | - $obj = Prado::createComponent((string)$node['class']); |
|
| 37 | - $this->setObjectPropFromNode($obj,$node,array('class')); |
|
| 36 | + $obj=Prado::createComponent((string) $node['class']); |
|
| 37 | + $this->setObjectPropFromNode($obj, $node, array('class')); |
|
| 38 | 38 | return $obj; |
| 39 | 39 | } |
| 40 | 40 | throw new TSqlMapConfigurationException( |
@@ -48,14 +48,14 @@ discard block |
||
| 48 | 48 | * @param SimpleXmlNode property node |
| 49 | 49 | * @param array exception property name |
| 50 | 50 | */ |
| 51 | - protected function setObjectPropFromNode($obj,$node,$except=array()) |
|
| 51 | + protected function setObjectPropFromNode($obj, $node, $except=array()) |
|
| 52 | 52 | { |
| 53 | 53 | foreach($node->attributes() as $name=>$value) |
| 54 | 54 | { |
| 55 | - if(!in_array($name,$except)) |
|
| 55 | + if(!in_array($name, $except)) |
|
| 56 | 56 | { |
| 57 | 57 | if($obj->canSetProperty($name)) |
| 58 | - $obj->{$name} = (string)$value; |
|
| 58 | + $obj->{$name}=(string) $value; |
|
| 59 | 59 | else |
| 60 | 60 | throw new TSqlMapConfigurationException( |
| 61 | 61 | 'sqlmap_invalid_property', $name, get_class($obj), |
@@ -69,12 +69,12 @@ discard block |
||
| 69 | 69 | * @param string relative filename |
| 70 | 70 | * @return string absolute filename. |
| 71 | 71 | */ |
| 72 | - protected function getAbsoluteFilePath($basefile,$resource) |
|
| 72 | + protected function getAbsoluteFilePath($basefile, $resource) |
|
| 73 | 73 | { |
| 74 | - $basedir = dirname($basefile); |
|
| 75 | - $file = realpath($basedir.DIRECTORY_SEPARATOR.$resource); |
|
| 74 | + $basedir=dirname($basefile); |
|
| 75 | + $file=realpath($basedir.DIRECTORY_SEPARATOR.$resource); |
|
| 76 | 76 | if(!is_string($file) || !is_file($file)) |
| 77 | - $file = realpath($resource); |
|
| 77 | + $file=realpath($resource); |
|
| 78 | 78 | if(is_string($file) && is_file($file)) |
| 79 | 79 | return $file; |
| 80 | 80 | else |
@@ -86,10 +86,10 @@ discard block |
||
| 86 | 86 | * @param string filename. |
| 87 | 87 | * @return SimpleXmlElement xml document. |
| 88 | 88 | */ |
| 89 | - protected function loadXmlDocument($filename,TSqlMapXmlConfiguration $config) |
|
| 89 | + protected function loadXmlDocument($filename, TSqlMapXmlConfiguration $config) |
|
| 90 | 90 | { |
| 91 | - if( strpos($filename, '${') !== false) |
|
| 92 | - $filename = $config->replaceProperties($filename); |
|
| 91 | + if(strpos($filename, '${')!==false) |
|
| 92 | + $filename=$config->replaceProperties($filename); |
|
| 93 | 93 | if(!is_file($filename)) |
| 94 | 94 | throw new TSqlMapConfigurationException( |
| 95 | 95 | 'sqlmap_unable_to_find_config', $filename); |
@@ -105,9 +105,9 @@ discard block |
||
| 105 | 105 | protected function getElementByIdValue($document, $tag, $value) |
| 106 | 106 | { |
| 107 | 107 | //hack to allow upper case and lower case attribute names. |
| 108 | - foreach(array('id','ID','Id', 'iD') as $id) |
|
| 108 | + foreach(array('id', 'ID', 'Id', 'iD') as $id) |
|
| 109 | 109 | { |
| 110 | - $xpath = "//{$tag}[@{$id}='{$value}']"; |
|
| 110 | + $xpath="//{$tag}[@{$id}='{$value}']"; |
|
| 111 | 111 | foreach($document->xpath($xpath) as $node) |
| 112 | 112 | return $node; |
| 113 | 113 | } |
@@ -28,8 +28,8 @@ discard block |
||
| 28 | 28 | { |
| 29 | 29 | protected $_keyList; |
| 30 | 30 | protected $_cache; |
| 31 | - protected $_cacheSize = 100; |
|
| 32 | - protected $_cacheModel = null; |
|
| 31 | + protected $_cacheSize=100; |
|
| 32 | + protected $_cacheModel=null; |
|
| 33 | 33 | |
| 34 | 34 | /** |
| 35 | 35 | * Create a new cache with limited cache size. |
@@ -37,8 +37,8 @@ discard block |
||
| 37 | 37 | */ |
| 38 | 38 | public function __construct($cacheModel=null) |
| 39 | 39 | { |
| 40 | - $this->_cache = new TMap; |
|
| 41 | - $this->_keyList = new TList; |
|
| 40 | + $this->_cache=new TMap; |
|
| 41 | + $this->_keyList=new TList; |
|
| 42 | 42 | $this->_cacheModel=$cacheModel; |
| 43 | 43 | } |
| 44 | 44 | |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | */ |
| 49 | 49 | public function setCacheSize($value) |
| 50 | 50 | { |
| 51 | - $this->_cacheSize=TPropertyValue::ensureInteger($value,100); |
|
| 51 | + $this->_cacheSize=TPropertyValue::ensureInteger($value, 100); |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | /** |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | */ |
| 65 | 65 | public function delete($key) |
| 66 | 66 | { |
| 67 | - $object = $this->get($key); |
|
| 67 | + $object=$this->get($key); |
|
| 68 | 68 | $this->_cache->remove($key); |
| 69 | 69 | $this->_keyList->remove($key); |
| 70 | 70 | return $object; |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | /** |
| 83 | 83 | * @throws TSqlMapException not implemented. |
| 84 | 84 | */ |
| 85 | - public function add($id,$value,$expire=0,$dependency=null) |
|
| 85 | + public function add($id, $value, $expire=0, $dependency=null) |
|
| 86 | 86 | { |
| 87 | 87 | throw new TSqlMapException('sqlmap_use_set_to_store_cache'); |
| 88 | 88 | } |