@@ -60,32 +60,32 @@ |
||
60 | 60 | /** |
61 | 61 | * Explain |
62 | 62 | */ |
63 | - $syntax[] = $this->getExplainSyntax(); |
|
63 | + $syntax[ ] = $this->getExplainSyntax(); |
|
64 | 64 | |
65 | 65 | /** |
66 | 66 | * UPDATE statement |
67 | 67 | */ |
68 | - $syntax[] = $this->statement; |
|
68 | + $syntax[ ] = $this->statement; |
|
69 | 69 | |
70 | 70 | /** |
71 | 71 | * PRIORITY |
72 | 72 | */ |
73 | - $syntax[] = $this->queryStructure->getElement( QueryStructure::PRIORITY ); |
|
73 | + $syntax[ ] = $this->queryStructure->getElement( QueryStructure::PRIORITY ); |
|
74 | 74 | |
75 | 75 | /** |
76 | 76 | * IGNORE clause |
77 | 77 | */ |
78 | - $syntax[] = $this->queryStructure->getElement( QueryStructure::IGNORE ) ? 'IGNORE' : ''; |
|
78 | + $syntax[ ] = $this->queryStructure->getElement( QueryStructure::IGNORE ) ? 'IGNORE' : ''; |
|
79 | 79 | |
80 | 80 | /** |
81 | 81 | * INTO table |
82 | 82 | */ |
83 | - $syntax[] = 'INTO ' . $this->queryStructure->getElement( QueryStructure::TABLE ); |
|
83 | + $syntax[ ] = 'INTO ' . $this->queryStructure->getElement( QueryStructure::TABLE ); |
|
84 | 84 | |
85 | 85 | /** |
86 | 86 | * FIELDS update |
87 | 87 | */ |
88 | - $syntax[] = $this->getSettingFieldsSyntax(); |
|
88 | + $syntax[ ] = $this->getSettingFieldsSyntax(); |
|
89 | 89 | |
90 | 90 | $syntax = implode( ' ', $syntax ); |
91 | 91 |
@@ -52,47 +52,47 @@ |
||
52 | 52 | /** |
53 | 53 | * Explain |
54 | 54 | */ |
55 | - $syntax[] = $this->getExplainSyntax(); |
|
55 | + $syntax[ ] = $this->getExplainSyntax(); |
|
56 | 56 | |
57 | 57 | /** |
58 | 58 | * UPDATE statement |
59 | 59 | */ |
60 | - $syntax[] = $this->statement; |
|
60 | + $syntax[ ] = $this->statement; |
|
61 | 61 | |
62 | 62 | /** |
63 | 63 | * PRIORITY |
64 | 64 | */ |
65 | - $syntax[] = $this->queryStructure->getElement( QueryStructure::PRIORITY ); |
|
65 | + $syntax[ ] = $this->queryStructure->getElement( QueryStructure::PRIORITY ); |
|
66 | 66 | |
67 | 67 | /** |
68 | 68 | * IGNORE clause |
69 | 69 | */ |
70 | - $syntax[] = $this->queryStructure->getElement( QueryStructure::IGNORE ) ? 'IGNORE' : ''; |
|
70 | + $syntax[ ] = $this->queryStructure->getElement( QueryStructure::IGNORE ) ? 'IGNORE' : ''; |
|
71 | 71 | |
72 | 72 | /** |
73 | 73 | * TABLE update |
74 | 74 | */ |
75 | - $syntax[] = $this->queryStructure->getElement( QueryStructure::TABLE ); |
|
75 | + $syntax[ ] = $this->queryStructure->getElement( QueryStructure::TABLE ); |
|
76 | 76 | |
77 | 77 | /** |
78 | 78 | * FIELDS update |
79 | 79 | */ |
80 | - $syntax[] = $this->getSettingFieldsSyntax(); |
|
80 | + $syntax[ ] = $this->getSettingFieldsSyntax(); |
|
81 | 81 | |
82 | 82 | /** |
83 | 83 | * WHERE clause |
84 | 84 | */ |
85 | - $syntax[] = $this->getWhereSyntax(); |
|
85 | + $syntax[ ] = $this->getWhereSyntax(); |
|
86 | 86 | |
87 | 87 | /** |
88 | 88 | * ORDER BY clause |
89 | 89 | */ |
90 | - $syntax[] = $this->getOrderBySyntax(); |
|
90 | + $syntax[ ] = $this->getOrderBySyntax(); |
|
91 | 91 | |
92 | 92 | /** |
93 | 93 | * LIMIT clause |
94 | 94 | */ |
95 | - $syntax[] = $this->getLimitSyntax(); |
|
95 | + $syntax[ ] = $this->getLimitSyntax(); |
|
96 | 96 | |
97 | 97 | $syntax = implode( ' ', $syntax ); |
98 | 98 |
@@ -106,8 +106,9 @@ |
||
106 | 106 | */ |
107 | 107 | public function execute() |
108 | 108 | { |
109 | - if ( $this->queryStructure->getElement( ( QueryStructure::WHERE_TRIGGER ) ) && !count( $this->queryStructure->getElement( QueryStructure::WHERE ) ) ) |
|
110 | - throw new QueryException( 'Where clause is required for this statement!', QueryException::QUERY_ERROR_DELETE_NOT_FILTER ); |
|
109 | + if ( $this->queryStructure->getElement( ( QueryStructure::WHERE_TRIGGER ) ) && !count( $this->queryStructure->getElement( QueryStructure::WHERE ) ) ) { |
|
110 | + throw new QueryException( 'Where clause is required for this statement!', QueryException::QUERY_ERROR_DELETE_NOT_FILTER ); |
|
111 | + } |
|
111 | 112 | |
112 | 113 | return DbService::getInstance()->query( $this->getSyntax(), $this->queryStructure->getElement( QueryStructure::BIND_PARAMS ) ); |
113 | 114 | } |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | /** |
36 | 36 | * @var array |
37 | 37 | */ |
38 | - protected $usedInstanceIds = []; |
|
38 | + protected $usedInstanceIds = [ ]; |
|
39 | 39 | |
40 | 40 | /** |
41 | 41 | * @var string |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | * @param array $params |
62 | 62 | * @return $this |
63 | 63 | */ |
64 | - public function withBindParams( array $params = [] ) |
|
64 | + public function withBindParams( array $params = [ ] ) |
|
65 | 65 | { |
66 | 66 | $this->queryStructure->replaceElement( QueryStructure::BIND_PARAMS, $params ); |
67 | 67 |
@@ -52,37 +52,37 @@ |
||
52 | 52 | /** |
53 | 53 | * Explain |
54 | 54 | */ |
55 | - $syntax[] = $this->getExplainSyntax(); |
|
55 | + $syntax[ ] = $this->getExplainSyntax(); |
|
56 | 56 | |
57 | 57 | /** |
58 | 58 | * UPDATE statement |
59 | 59 | */ |
60 | - $syntax[] = $this->statement; |
|
60 | + $syntax[ ] = $this->statement; |
|
61 | 61 | |
62 | 62 | /** |
63 | 63 | * PRIORITY |
64 | 64 | */ |
65 | - $syntax[] = $this->queryStructure->getElement( QueryStructure::PRIORITY ); |
|
65 | + $syntax[ ] = $this->queryStructure->getElement( QueryStructure::PRIORITY ); |
|
66 | 66 | |
67 | 67 | /** |
68 | 68 | * TABLE update |
69 | 69 | */ |
70 | - $syntax[] = 'FROM ' . $this->queryStructure->getElement( QueryStructure::TABLE ); |
|
70 | + $syntax[ ] = 'FROM ' . $this->queryStructure->getElement( QueryStructure::TABLE ); |
|
71 | 71 | |
72 | 72 | /** |
73 | 73 | * WHERE clause |
74 | 74 | */ |
75 | - $syntax[] = $this->getWhereSyntax(); |
|
75 | + $syntax[ ] = $this->getWhereSyntax(); |
|
76 | 76 | |
77 | 77 | /** |
78 | 78 | * ORDER BY clause |
79 | 79 | */ |
80 | - $syntax[] = $this->getOrderBySyntax(); |
|
80 | + $syntax[ ] = $this->getOrderBySyntax(); |
|
81 | 81 | |
82 | 82 | /** |
83 | 83 | * LIMIT clause |
84 | 84 | */ |
85 | - $syntax[] = $this->getLimitSyntax(); |
|
85 | + $syntax[ ] = $this->getLimitSyntax(); |
|
86 | 86 | |
87 | 87 | $syntax = implode( ' ', $syntax ); |
88 | 88 |
@@ -96,8 +96,9 @@ |
||
96 | 96 | public function execute() |
97 | 97 | { |
98 | 98 | |
99 | - if ( $this->queryStructure->getElement( ( QueryStructure::WHERE_TRIGGER ) ) && !count( $this->queryStructure->getElement( QueryStructure::WHERE ) ) ) |
|
100 | - throw new QueryException( 'Where or Having clause is required for this statement!', QueryException::QUERY_ERROR_DELETE_NOT_FILTER ); |
|
99 | + if ( $this->queryStructure->getElement( ( QueryStructure::WHERE_TRIGGER ) ) && !count( $this->queryStructure->getElement( QueryStructure::WHERE ) ) ) { |
|
100 | + throw new QueryException( 'Where or Having clause is required for this statement!', QueryException::QUERY_ERROR_DELETE_NOT_FILTER ); |
|
101 | + } |
|
101 | 102 | |
102 | 103 | return DbService::getInstance()->query( $this->getSyntax(), $this->queryStructure->getElement( QueryStructure::BIND_PARAMS ) ); |
103 | 104 |
@@ -49,7 +49,7 @@ |
||
49 | 49 | /** |
50 | 50 | * @var array |
51 | 51 | */ |
52 | - protected $usedInstanceIds = []; |
|
52 | + protected $usedInstanceIds = [ ]; |
|
53 | 53 | |
54 | 54 | /** |
55 | 55 | * @var string |
@@ -49,32 +49,32 @@ |
||
49 | 49 | /** |
50 | 50 | * Explain |
51 | 51 | */ |
52 | - $syntax[] = $this->getExplainSyntax(); |
|
52 | + $syntax[ ] = $this->getExplainSyntax(); |
|
53 | 53 | |
54 | 54 | /** |
55 | 55 | * UPDATE statement |
56 | 56 | */ |
57 | - $syntax[] = $this->statement; |
|
57 | + $syntax[ ] = $this->statement; |
|
58 | 58 | |
59 | 59 | /** |
60 | 60 | * PRIORITY |
61 | 61 | */ |
62 | - $syntax[] = $this->queryStructure->getElement( QueryStructure::PRIORITY ); |
|
62 | + $syntax[ ] = $this->queryStructure->getElement( QueryStructure::PRIORITY ); |
|
63 | 63 | |
64 | 64 | /** |
65 | 65 | * IGNORE clause |
66 | 66 | */ |
67 | - $syntax[] = $this->queryStructure->getElement( QueryStructure::IGNORE ) ? 'IGNORE' : ''; |
|
67 | + $syntax[ ] = $this->queryStructure->getElement( QueryStructure::IGNORE ) ? 'IGNORE' : ''; |
|
68 | 68 | |
69 | 69 | /** |
70 | 70 | * INTO table |
71 | 71 | */ |
72 | - $syntax[] = 'INTO ' . $this->queryStructure->getElement( QueryStructure::TABLE ); |
|
72 | + $syntax[ ] = 'INTO ' . $this->queryStructure->getElement( QueryStructure::TABLE ); |
|
73 | 73 | |
74 | 74 | /** |
75 | 75 | * FIELDS update |
76 | 76 | */ |
77 | - $syntax[] = $this->getInsertMultipleRowsSyntax(); |
|
77 | + $syntax[ ] = $this->getInsertMultipleRowsSyntax(); |
|
78 | 78 | |
79 | 79 | $syntax = implode( ' ', $syntax ); |
80 | 80 |