@@ -611,15 +611,15 @@ |
||
| 611 | 611 | function _hash($data, $controlType) |
| 612 | 612 | { |
| 613 | 613 | switch ($controlType) { |
| 614 | - case 'md5': |
|
| 615 | - return md5($data); |
|
| 616 | - case 'crc32': |
|
| 617 | - return sprintf('% 32d', crc32($data)); |
|
| 618 | - case 'strlen': |
|
| 619 | - return sprintf('% 32d', strlen($data)); |
|
| 620 | - default: |
|
| 621 | - $this->raiseError('Unknown controlType ! '. |
|
| 622 | - '(available values are only \'md5\', \'crc32\', \'strlen\')', -5); |
|
| 614 | + case 'md5': |
|
| 615 | + return md5($data); |
|
| 616 | + case 'crc32': |
|
| 617 | + return sprintf('% 32d', crc32($data)); |
|
| 618 | + case 'strlen': |
|
| 619 | + return sprintf('% 32d', strlen($data)); |
|
| 620 | + default: |
|
| 621 | + $this->raiseError('Unknown controlType ! '. |
|
| 622 | + '(available values are only \'md5\', \'crc32\', \'strlen\')', -5); |
|
| 623 | 623 | } |
| 624 | 624 | } |
| 625 | 625 | |
@@ -191,8 +191,7 @@ discard block |
||
| 191 | 191 | default: |
| 192 | 192 | if ($this->isAlphaNum($this->b)) { |
| 193 | 193 | $this->action(1); |
| 194 | - } |
|
| 195 | - else { |
|
| 194 | + } else { |
|
| 196 | 195 | $this->action(2); |
| 197 | 196 | } |
| 198 | 197 | } |
@@ -224,8 +223,7 @@ discard block |
||
| 224 | 223 | default: |
| 225 | 224 | if ($this->isAlphaNum($this->a)) { |
| 226 | 225 | $this->action(1); |
| 227 | - } |
|
| 228 | - else { |
|
| 226 | + } else { |
|
| 229 | 227 | $this->action(3); |
| 230 | 228 | } |
| 231 | 229 | } |
@@ -129,28 +129,24 @@ |
||
| 129 | 129 | { |
| 130 | 130 | $param->setData($data); |
| 131 | 131 | $this->_nextPageList = null; |
| 132 | - } |
|
| 133 | - else |
|
| 132 | + } else |
|
| 134 | 133 | { |
| 135 | 134 | $param->setData(array_slice($data, 0, $pageSize)); |
| 136 | 135 | $this->_nextPageList = array_slice($data, $pageSize-1,$total); |
| 137 | 136 | } |
| 138 | - } |
|
| 139 | - else |
|
| 137 | + } else |
|
| 140 | 138 | { |
| 141 | 139 | if($total <= $pageSize) |
| 142 | 140 | { |
| 143 | 141 | $this->_prevPageList = array_slice($data, 0, $total); |
| 144 | 142 | $param->setData(array()); |
| 145 | 143 | $this->_nextPageList = null; |
| 146 | - } |
|
| 147 | - else if($total <= $pageSize*2) |
|
| 144 | + } else if($total <= $pageSize*2) |
|
| 148 | 145 | { |
| 149 | 146 | $this->_prevPageList = array_slice($data, 0, $pageSize); |
| 150 | 147 | $param->setData(array_slice($data, $pageSize, $total)); |
| 151 | 148 | $this->_nextPageList = null; |
| 152 | - } |
|
| 153 | - else |
|
| 149 | + } else |
|
| 154 | 150 | { |
| 155 | 151 | $this->_prevPageList = array_slice($data, 0, $pageSize); |
| 156 | 152 | $param->setData(array_slice($data, $pageSize, $pageSize)); |
@@ -416,8 +416,7 @@ |
||
| 416 | 416 | { |
| 417 | 417 | $useArgs = !is_array($parameters) && is_array($args); |
| 418 | 418 | return new TSqlCriteria($criteria,$useArgs ? $args : $parameters); |
| 419 | - } |
|
| 420 | - else if($criteria instanceof TSqlCriteria) |
|
| 419 | + } else if($criteria instanceof TSqlCriteria) |
|
| 421 | 420 | return $criteria; |
| 422 | 421 | else |
| 423 | 422 | throw new TDbException('dbtablegateway_invalid_criteria'); |
@@ -58,8 +58,7 @@ |
||
| 58 | 58 | if ($this->sourcepath === NULL) |
| 59 | 59 | { |
| 60 | 60 | $this->sourcepath = $sourcepath; |
| 61 | - } |
|
| 62 | - else |
|
| 61 | + } else |
|
| 63 | 62 | { |
| 64 | 63 | $this->sourcepath->append($sourcepath); |
| 65 | 64 | } |
@@ -115,8 +115,7 @@ discard block |
||
| 115 | 115 | $columns = $this->getTableInfo()->getColumns(); |
| 116 | 116 | $this->getInputRepeater()->setDataSource($columns); |
| 117 | 117 | $this->getInputRepeater()->dataBind(); |
| 118 | - } |
|
| 119 | - else |
|
| 118 | + } else |
|
| 120 | 119 | { |
| 121 | 120 | if($this->_editRenderer===null) |
| 122 | 121 | $this->createEditRenderer($record, $classPath); |
@@ -140,8 +139,7 @@ discard block |
||
| 140 | 139 | $index = $this->getControls()->remove($this->getInputRepeater()); |
| 141 | 140 | $this->getControls()->insertAt($index,$this->_editRenderer); |
| 142 | 141 | $this->_editRenderer->setData($record); |
| 143 | - } |
|
| 144 | - else |
|
| 142 | + } else |
|
| 145 | 143 | { |
| 146 | 144 | throw new TConfigurationException( |
| 147 | 145 | 'scaffold_invalid_edit_renderer', $this->getID(), get_class($record)); |
@@ -204,15 +202,13 @@ discard block |
||
| 204 | 202 | $column = $table->getColumn($item->getCustomData()); |
| 205 | 203 | $builder->loadScaffoldInput($this, $item, $column, $record); |
| 206 | 204 | } |
| 207 | - } |
|
| 208 | - else |
|
| 205 | + } else |
|
| 209 | 206 | { |
| 210 | 207 | $this->_editRenderer->updateRecord($record); |
| 211 | 208 | } |
| 212 | 209 | $record->save(); |
| 213 | 210 | return true; |
| 214 | - } |
|
| 215 | - else if($this->_editRenderer!==null) |
|
| 211 | + } else if($this->_editRenderer!==null) |
|
| 216 | 212 | { |
| 217 | 213 | //preserve the form data. |
| 218 | 214 | $this->_editRenderer->updateRecord($this->getCurrentRecord()); |
@@ -67,16 +67,14 @@ |
||
| 67 | 67 | throw new TActiveRecordException('ar_invalid_tablename_property', |
| 68 | 68 | get_class($record),self::TABLE_CONST); |
| 69 | 69 | return $value; |
| 70 | - } |
|
| 71 | - elseif ($class->hasMethod(self::TABLE_METHOD)) |
|
| 70 | + } elseif ($class->hasMethod(self::TABLE_METHOD)) |
|
| 72 | 71 | { |
| 73 | 72 | $value = $record->{self::TABLE_METHOD}(); |
| 74 | 73 | if(empty($value)) |
| 75 | 74 | throw new TActiveRecordException('ar_invalid_tablename_method', |
| 76 | 75 | get_class($record),self::TABLE_METHOD); |
| 77 | 76 | return $value; |
| 78 | - } |
|
| 79 | - else |
|
| 77 | + } else |
|
| 80 | 78 | return strtolower(get_class($record)); |
| 81 | 79 | } |
| 82 | 80 | |
@@ -189,8 +189,7 @@ discard block |
||
| 189 | 189 | $this->_pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); |
| 190 | 190 | $this->_active=true; |
| 191 | 191 | $this->setConnectionCharset(); |
| 192 | - } |
|
| 193 | - catch(PDOException $e) |
|
| 192 | + } catch(PDOException $e) |
|
| 194 | 193 | { |
| 195 | 194 | throw new TDbException('dbconnection_open_failed',$e->getMessage()); |
| 196 | 195 | } |
@@ -343,8 +342,7 @@ discard block |
||
| 343 | 342 | { |
| 344 | 343 | $this->_pdo->beginTransaction(); |
| 345 | 344 | return $this->_transaction=Prado::createComponent($this->getTransactionClass(), $this); |
| 346 | - } |
|
| 347 | - else |
|
| 345 | + } else |
|
| 348 | 346 | throw new TDbException('dbconnection_connection_inactive'); |
| 349 | 347 | } |
| 350 | 348 | |
@@ -58,8 +58,7 @@ |
||
| 58 | 58 | if ($this->sourcepath === NULL) |
| 59 | 59 | { |
| 60 | 60 | $this->sourcepath = $sourcepath; |
| 61 | - } |
|
| 62 | - else |
|
| 61 | + } else |
|
| 63 | 62 | { |
| 64 | 63 | $this->sourcepath->append($sourcepath); |
| 65 | 64 | } |