@@ -28,7 +28,7 @@ |
||
28 | 28 | class TOracleTableColumn extends TDbTableColumn |
29 | 29 | { |
30 | 30 | private static $types = [ |
31 | - 'numeric' => [ 'numeric' ] |
|
31 | + 'numeric' => ['numeric'] |
|
32 | 32 | // 'integer' => array('bit', 'bit varying', 'real', 'serial', 'int', 'integer'), |
33 | 33 | // 'boolean' => array('boolean'), |
34 | 34 | // 'float' => array('bigint', 'bigserial', 'double precision', 'money', 'numeric') |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | { |
79 | 79 | static $stack = []; |
80 | 80 | |
81 | - $results = call_user_func_array([$this->getSourceRecord(),$method], $args); |
|
81 | + $results = call_user_func_array([$this->getSourceRecord(), $method], $args); |
|
82 | 82 | $validArray = is_array($results) && count($results) > 0; |
83 | 83 | if($validArray || $results instanceof \ArrayAccess || $results instanceof TActiveRecord) |
84 | 84 | { |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | { |
173 | 173 | $ids = []; |
174 | 174 | foreach($properties as $property) |
175 | - $ids[] = is_object($obj) ? (string)$obj->getColumnValue($property) : (string)$obj[$property]; |
|
175 | + $ids[] = is_object($obj) ? (string) $obj->getColumnValue($property) : (string) $obj[$property]; |
|
176 | 176 | return serialize($ids); |
177 | 177 | } |
178 | 178 | |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | { |
235 | 235 | if(is_array($results) || $results instanceof \ArrayAccess) |
236 | 236 | { |
237 | - for($i = 0,$k = count($results);$i < $k;$i++) |
|
237 | + for($i = 0, $k = count($results); $i < $k; $i++) |
|
238 | 238 | $this->setObjectProperty($results[$i], $properties, $collections); |
239 | 239 | } |
240 | 240 | else |
@@ -109,7 +109,7 @@ |
||
109 | 109 | { |
110 | 110 | $source = $this->getSourceRecord(); |
111 | 111 | $fkeys = $this->findForeignKeys($fkObjects[0], $source); |
112 | - for($i = 0;$i < $total;$i++) |
|
112 | + for($i = 0; $i < $total; $i++) |
|
113 | 113 | { |
114 | 114 | foreach($fkeys as $fKey => $srcKey) |
115 | 115 | $fkObjects[$i]->setColumnValue($fKey, $source->getColumnValue($srcKey)); |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | */ |
118 | 118 | public function getCondition() |
119 | 119 | { |
120 | - return isset($this->_relation[3])?$this->_relation[3]:null; |
|
120 | + return isset($this->_relation[3]) ? $this->_relation[3] : null; |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | /** |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | */ |
127 | 127 | public function getParameters() |
128 | 128 | { |
129 | - return isset($this->_relation[4])?$this->_relation[4]:[]; |
|
129 | + return isset($this->_relation[4]) ? $this->_relation[4] : []; |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | /** |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | { |
18 | 18 | protected function createControl($container, $column, $record) |
19 | 19 | { |
20 | - $dbtype = trim(str_replace(['unsigned', 'zerofill'], ['','',], strtolower($column->getDbType()))); |
|
20 | + $dbtype = trim(str_replace(['unsigned', 'zerofill'], ['', '', ], strtolower($column->getDbType()))); |
|
21 | 21 | switch($dbtype) |
22 | 22 | { |
23 | 23 | case 'date': |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | |
47 | 47 | protected function getControlValue($container, $column, $record) |
48 | 48 | { |
49 | - $dbtype = trim(str_replace(['unsigned', 'zerofill'], ['','',], strtolower($column->getDbType()))); |
|
49 | + $dbtype = trim(str_replace(['unsigned', 'zerofill'], ['', '', ], strtolower($column->getDbType()))); |
|
50 | 50 | switch($dbtype) |
51 | 51 | { |
52 | 52 | case 'date': |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | protected function getIntBooleanValue($container, $column, $record) |
80 | 80 | { |
81 | 81 | if($column->getColumnSize() == 1) |
82 | - return (int)$container->findControl(self::DEFAULT_ID)->getChecked(); |
|
82 | + return (int) $container->findControl(self::DEFAULT_ID)->getChecked(); |
|
83 | 83 | else |
84 | 84 | return $this->getDefaultControlValue($container, $column, $record); |
85 | 85 | } |
@@ -129,7 +129,7 @@ |
||
129 | 129 | public function setGatewayClass($value) |
130 | 130 | { |
131 | 131 | $this->_gateway = null; |
132 | - $this->_gatewayClass = (string)$value; |
|
132 | + $this->_gatewayClass = (string) $value; |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | /** |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | $class = new ReflectionClass($className); |
295 | 295 | $relations = []; |
296 | 296 | foreach($class->getStaticPropertyValue('RELATIONS') as $key => $value) |
297 | - $relations[strtolower($key)] = [$key,$value]; |
|
297 | + $relations[strtolower($key)] = [$key, $value]; |
|
298 | 298 | self::$_relations[$className] = $relations; |
299 | 299 | } |
300 | 300 | } |
@@ -495,7 +495,7 @@ discard block |
||
495 | 495 | { |
496 | 496 | if(func_num_args() > 1) |
497 | 497 | $keys = func_get_args(); |
498 | - return $this->getRecordGateway()->deleteRecordsByPk($this, (array)$keys); |
|
498 | + return $this->getRecordGateway()->deleteRecordsByPk($this, (array) $keys); |
|
499 | 499 | } |
500 | 500 | |
501 | 501 | /** |
@@ -647,7 +647,7 @@ discard block |
||
647 | 647 | { |
648 | 648 | if(func_num_args() > 1) |
649 | 649 | $keys = func_get_args(); |
650 | - $result = $this->getRecordGateway()->findRecordsByPks($this, (array)$keys); |
|
650 | + $result = $this->getRecordGateway()->findRecordsByPks($this, (array) $keys); |
|
651 | 651 | return $this->populateObjects($result); |
652 | 652 | } |
653 | 653 | |
@@ -1010,7 +1010,7 @@ discard block |
||
1010 | 1010 | { |
1011 | 1011 | $className = get_class($this); |
1012 | 1012 | $property = strtolower($property); |
1013 | - return isset(self::$_relations[$className][$property])?self::$_relations[$className][$property]:null; |
|
1013 | + return isset(self::$_relations[$className][$property]) ?self::$_relations[$className][$property] : null; |
|
1014 | 1014 | } |
1015 | 1015 | |
1016 | 1016 | /** |
@@ -1037,9 +1037,9 @@ discard block |
||
1037 | 1037 | * @return array of column name and column values |
1038 | 1038 | * @since 3.2.4 |
1039 | 1039 | */ |
1040 | - public function toArray(){ |
|
1040 | + public function toArray() { |
|
1041 | 1041 | $result = []; |
1042 | - foreach($this->getRecordTableInfo()->getLowerCaseColumnNames() as $columnName){ |
|
1042 | + foreach($this->getRecordTableInfo()->getLowerCaseColumnNames() as $columnName) { |
|
1043 | 1043 | $result[$columnName] = $this->getColumnValue($columnName); |
1044 | 1044 | } |
1045 | 1045 | |
@@ -1051,7 +1051,7 @@ discard block |
||
1051 | 1051 | * @return JSON |
1052 | 1052 | * @since 3.2.4 |
1053 | 1053 | */ |
1054 | - public function toJSON(){ |
|
1054 | + public function toJSON() { |
|
1055 | 1055 | return json_encode($this->toArray()); |
1056 | 1056 | } |
1057 | 1057 | } |
1058 | 1058 | \ No newline at end of file |
@@ -79,7 +79,7 @@ |
||
79 | 79 | public function setFetchMode($mode) |
80 | 80 | { |
81 | 81 | $params = func_get_args(); |
82 | - call_user_func_array([$this->_statement,'setFetchMode'], $params); |
|
82 | + call_user_func_array([$this->_statement, 'setFetchMode'], $params); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | /** |
@@ -138,12 +138,12 @@ |
||
138 | 138 | public function __sleep() |
139 | 139 | { |
140 | 140 | $exprops = []; $cn = 'TParameterProperty'; |
141 | - if ($this->_typeHandler === null) $exprops[] = "\0$cn\0_typeHandler"; |
|
142 | - if ($this->_type === null) $exprops[] = "\0$cn\0_type"; |
|
143 | - if ($this->_column === null) $exprops[] = "\0$cn\0_column"; |
|
144 | - if ($this->_dbType === null) $exprops[] = "\0$cn\0_dbType"; |
|
145 | - if ($this->_property === null) $exprops[] = "\0$cn\0_property"; |
|
146 | - if ($this->_nullValue === null) $exprops[] = "\0$cn\0_nullValue"; |
|
141 | + if($this->_typeHandler === null) $exprops[] = "\0$cn\0_typeHandler"; |
|
142 | + if($this->_type === null) $exprops[] = "\0$cn\0_type"; |
|
143 | + if($this->_column === null) $exprops[] = "\0$cn\0_column"; |
|
144 | + if($this->_dbType === null) $exprops[] = "\0$cn\0_dbType"; |
|
145 | + if($this->_property === null) $exprops[] = "\0$cn\0_property"; |
|
146 | + if($this->_nullValue === null) $exprops[] = "\0$cn\0_nullValue"; |
|
147 | 147 | return array_diff(parent::__sleep(), $exprops); |
148 | 148 | } |
149 | 149 | } |