@@ -260,8 +260,7 @@ discard block |
||
| 260 | 260 | } else { |
| 261 | 261 | $value = $item->$colName; |
| 262 | 262 | } |
| 263 | - } |
|
| 264 | - else { |
|
| 263 | + } else { |
|
| 265 | 264 | $value = $item->$colName; |
| 266 | 265 | } |
| 267 | 266 | break; |
@@ -751,17 +750,21 @@ discard block |
||
| 751 | 750 | if (!$query) { |
| 752 | 751 | return []; |
| 753 | 752 | } |
| 754 | - if (!empty($options['where'])) |
|
| 755 | - $query->where($options['where']); |
|
| 753 | + if (!empty($options['where'])) { |
|
| 754 | + $query->where($options['where']); |
|
| 755 | + } |
|
| 756 | 756 | if (!empty($options['group'])) { |
| 757 | 757 | $query->group($options['group']); |
| 758 | 758 | } |
| 759 | - if (!empty($options['order'])) |
|
| 760 | - $query->order($options['order']); |
|
| 761 | - if (!empty($options['join'])) |
|
| 762 | - $query->join($options['join']); |
|
| 763 | - if (!empty($options['distinct'])) |
|
| 764 | - $query->distinct = $options['distinct']; |
|
| 759 | + if (!empty($options['order'])) { |
|
| 760 | + $query->order($options['order']); |
|
| 761 | + } |
|
| 762 | + if (!empty($options['join'])) { |
|
| 763 | + $query->join($options['join']); |
|
| 764 | + } |
|
| 765 | + if (!empty($options['distinct'])) { |
|
| 766 | + $query->distinct = $options['distinct']; |
|
| 767 | + } |
|
| 765 | 768 | |
| 766 | 769 | foreach (static::$relJoins as $join) { |
| 767 | 770 | $query->join($join[0], $join[1]); |
@@ -787,14 +790,14 @@ discard block |
||
| 787 | 790 | } |
| 788 | 791 | static::$needJoin = []; |
| 789 | 792 | |
| 790 | - if (!empty($options['limit'])) |
|
| 791 | - $limit = (int) $options['limit']; |
|
| 792 | - else { |
|
| 793 | + if (!empty($options['limit'])) { |
|
| 794 | + $limit = (int) $options['limit']; |
|
| 795 | + } else { |
|
| 793 | 796 | $limit = 0; |
| 794 | 797 | } |
| 795 | - if (!empty($options['start'])) |
|
| 796 | - $start = (int) $options['start']; |
|
| 797 | - else { |
|
| 798 | + if (!empty($options['start'])) { |
|
| 799 | + $start = (int) $options['start']; |
|
| 800 | + } else { |
|
| 798 | 801 | $start = 0; |
| 799 | 802 | } |
| 800 | 803 | if ($limit || $start) { |
@@ -1061,21 +1064,23 @@ discard block |
||
| 1061 | 1064 | if (!empty($options['where'])) { |
| 1062 | 1065 | static::fixPrefix($options['where'], 'first'); |
| 1063 | 1066 | } |
| 1064 | - if (!empty($options['where'])) |
|
| 1065 | - $query->where($options['where']); |
|
| 1066 | - if (!empty($options['join'])) |
|
| 1067 | - $query->join($options['join']); |
|
| 1067 | + if (!empty($options['where'])) { |
|
| 1068 | + $query->where($options['where']); |
|
| 1069 | + } |
|
| 1070 | + if (!empty($options['join'])) { |
|
| 1071 | + $query->join($options['join']); |
|
| 1072 | + } |
|
| 1068 | 1073 | if (!empty($options['order'])) { |
| 1069 | 1074 | $query->order($options['order']); |
| 1070 | 1075 | } |
| 1071 | - if (!empty($options['limit'])) |
|
| 1072 | - $limit = (int) $options['limit']; |
|
| 1073 | - else { |
|
| 1076 | + if (!empty($options['limit'])) { |
|
| 1077 | + $limit = (int) $options['limit']; |
|
| 1078 | + } else { |
|
| 1074 | 1079 | $limit = 0; |
| 1075 | 1080 | } |
| 1076 | - if (!empty($options['start'])) |
|
| 1077 | - $start = (int) $options['start']; |
|
| 1078 | - else { |
|
| 1081 | + if (!empty($options['start'])) { |
|
| 1082 | + $start = (int) $options['start']; |
|
| 1083 | + } else { |
|
| 1079 | 1084 | $start = 0; |
| 1080 | 1085 | } |
| 1081 | 1086 | if ($limit || $start) { |
@@ -1153,8 +1158,9 @@ discard block |
||
| 1153 | 1158 | |
| 1154 | 1159 | $values = []; |
| 1155 | 1160 | foreach ($cols as $col => $param) { |
| 1156 | - if (isset($params[$col])) |
|
| 1157 | - $values[$col] = $params[$col]; |
|
| 1161 | + if (isset($params[$col])) { |
|
| 1162 | + $values[$col] = $params[$col]; |
|
| 1163 | + } |
|
| 1158 | 1164 | } |
| 1159 | 1165 | if (empty($values)) { |
| 1160 | 1166 | return false; |
@@ -1337,8 +1343,9 @@ discard block |
||
| 1337 | 1343 | $values = []; |
| 1338 | 1344 | |
| 1339 | 1345 | foreach ($this->cols() as $col => $param) { |
| 1340 | - if (isset($this->_params[$col])) |
|
| 1341 | - $values[$col] = $this->_params[$col]; |
|
| 1346 | + if (isset($this->_params[$col])) { |
|
| 1347 | + $values[$col] = $this->_params[$col]; |
|
| 1348 | + } |
|
| 1342 | 1349 | } |
| 1343 | 1350 | if (empty($values) && empty($options['empty'])) { |
| 1344 | 1351 | return false; |
@@ -1498,8 +1505,9 @@ discard block |
||
| 1498 | 1505 | { |
| 1499 | 1506 | |
| 1500 | 1507 | foreach (static::relations() as $relName => $rel) { |
| 1501 | - if ($rel['col'] == $col) |
|
| 1502 | - return $relName; |
|
| 1508 | + if ($rel['col'] == $col) { |
|
| 1509 | + return $relName; |
|
| 1510 | + } |
|
| 1503 | 1511 | } |
| 1504 | 1512 | return NULL; |
| 1505 | 1513 | } |