File tree Expand file tree Collapse file tree 1 file changed +18
-14
lines changed Expand file tree Collapse file tree 1 file changed +18
-14
lines changed Original file line number Diff line number Diff line change @@ -52,23 +52,28 @@ class QueryBuilder
52
52
*/
53
53
private $ connection ;
54
54
55
+ /*
56
+ * The default values of SQL parts collection
57
+ */
58
+ private const SQL_PARTS_DEFAULTS = [
59
+ 'select ' => [],
60
+ 'distinct ' => false ,
61
+ 'from ' => [],
62
+ 'join ' => [],
63
+ 'set ' => [],
64
+ 'where ' => null ,
65
+ 'groupBy ' => [],
66
+ 'having ' => null ,
67
+ 'orderBy ' => [],
68
+ 'values ' => [],
69
+ ];
70
+
55
71
/**
56
72
* The array of SQL parts collected.
57
73
*
58
74
* @var mixed[]
59
75
*/
60
- private $ sqlParts = [
61
- 'select ' => [],
62
- 'distinct ' => false ,
63
- 'from ' => [],
64
- 'join ' => [],
65
- 'set ' => [],
66
- 'where ' => null ,
67
- 'groupBy ' => [],
68
- 'having ' => null ,
69
- 'orderBy ' => [],
70
- 'values ' => [],
71
- ];
76
+ private $ sqlParts = self ::SQL_PARTS_DEFAULTS ;
72
77
73
78
/**
74
79
* The complete SQL string for this query.
@@ -1103,8 +1108,7 @@ public function resetQueryParts($queryPartNames = null)
1103
1108
*/
1104
1109
public function resetQueryPart ($ queryPartName )
1105
1110
{
1106
- $ this ->sqlParts [$ queryPartName ] = is_array ($ this ->sqlParts [$ queryPartName ])
1107
- ? [] : null ;
1111
+ $ this ->sqlParts [$ queryPartName ] = self ::SQL_PARTS_DEFAULTS [$ queryPartName ];
1108
1112
1109
1113
$ this ->state = self ::STATE_DIRTY ;
1110
1114
You can’t perform that action at this time.
0 commit comments