@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | */ |
28 | 28 | function SelectColumnsTag($xml_columns_tag) |
29 | 29 | { |
30 | - if(!$xml_columns_tag) |
|
30 | + if (!$xml_columns_tag) |
|
31 | 31 | { |
32 | 32 | $xml_columns_tag = new Xml_Node_(); |
33 | 33 | } |
@@ -37,34 +37,34 @@ discard block |
||
37 | 37 | |
38 | 38 | $this->columns = array(); |
39 | 39 | |
40 | - if(!$xml_columns) |
|
40 | + if (!$xml_columns) |
|
41 | 41 | { |
42 | 42 | $this->columns[] = new SelectColumnTag("*"); |
43 | 43 | return; |
44 | 44 | } |
45 | 45 | |
46 | - if(!is_array($xml_columns)) |
|
46 | + if (!is_array($xml_columns)) |
|
47 | 47 | { |
48 | 48 | $xml_columns = array($xml_columns); |
49 | 49 | } |
50 | 50 | |
51 | - foreach($xml_columns as $column) |
|
51 | + foreach ($xml_columns as $column) |
|
52 | 52 | { |
53 | 53 | $this->columns[] = new SelectColumnTag($column); |
54 | 54 | } |
55 | 55 | |
56 | 56 | |
57 | - if(!$xml_queries) |
|
57 | + if (!$xml_queries) |
|
58 | 58 | { |
59 | 59 | return; |
60 | 60 | } |
61 | 61 | |
62 | - if(!is_array($xml_queries)) |
|
62 | + if (!is_array($xml_queries)) |
|
63 | 63 | { |
64 | 64 | $xml_queries = array($xml_queries); |
65 | 65 | } |
66 | 66 | |
67 | - foreach($xml_queries as $column) |
|
67 | + foreach ($xml_queries as $column) |
|
68 | 68 | { |
69 | 69 | $this->columns[] = new QueryTag($column, TRUE); |
70 | 70 | } |
@@ -78,9 +78,9 @@ discard block |
||
78 | 78 | function toString() |
79 | 79 | { |
80 | 80 | $output_columns = 'array(' . PHP_EOL; |
81 | - foreach($this->columns as $column) |
|
81 | + foreach ($this->columns as $column) |
|
82 | 82 | { |
83 | - if(is_a($column, 'QueryTag')) |
|
83 | + if (is_a($column, 'QueryTag')) |
|
84 | 84 | { |
85 | 85 | $output_columns .= $column->toString() . PHP_EOL . ','; |
86 | 86 | } |
@@ -102,9 +102,9 @@ discard block |
||
102 | 102 | function getArguments() |
103 | 103 | { |
104 | 104 | $arguments = array(); |
105 | - foreach($this->columns as $column) |
|
105 | + foreach ($this->columns as $column) |
|
106 | 106 | { |
107 | - if(is_a($column, 'QueryTag')) |
|
107 | + if (is_a($column, 'QueryTag')) |
|
108 | 108 | { |
109 | 109 | $arguments = array_merge($arguments, $column->getArguments()); |
110 | 110 | } |
@@ -38,8 +38,7 @@ |
||
38 | 38 | if($column->name === 'query') |
39 | 39 | { |
40 | 40 | $this->columns[] = new QueryTag($column, true); |
41 | - } |
|
42 | - else |
|
41 | + } else |
|
43 | 42 | { |
44 | 43 | $this->columns[] = new UpdateColumnTag($column); |
45 | 44 | } |
@@ -38,20 +38,20 @@ discard block |
||
38 | 38 | $dbParser = DB::getParser(); |
39 | 39 | $this->name = $dbParser->parseColumnName($this->name); |
40 | 40 | |
41 | - if($column->attrs->var) |
|
41 | + if ($column->attrs->var) |
|
42 | 42 | { |
43 | 43 | $this->argument = new QueryArgument($column); |
44 | 44 | } |
45 | 45 | else |
46 | 46 | { |
47 | - if(strpos($column->attrs->default, '.') !== FALSE) |
|
47 | + if (strpos($column->attrs->default, '.') !== FALSE) |
|
48 | 48 | { |
49 | 49 | $this->default_value = "'" . $dbParser->parseColumnName($column->attrs->default) . "'"; |
50 | 50 | } |
51 | 51 | else |
52 | 52 | { |
53 | 53 | $default_value = new DefaultValue($this->name, $column->attrs->default); |
54 | - if($default_value->isOperation()) |
|
54 | + if ($default_value->isOperation()) |
|
55 | 55 | { |
56 | 56 | $this->argument = new QueryArgument($column, TRUE); |
57 | 57 | } |
@@ -59,11 +59,11 @@ discard block |
||
59 | 59 | else |
60 | 60 | { |
61 | 61 | $this->default_value = $default_value->toString(); |
62 | - if($default_value->isStringFromFunction()) |
|
62 | + if ($default_value->isStringFromFunction()) |
|
63 | 63 | { |
64 | 64 | $this->default_value = '"\'".' . $this->default_value . '."\'"'; |
65 | 65 | } |
66 | - if($default_value->isString()) |
|
66 | + if ($default_value->isString()) |
|
67 | 67 | { |
68 | 68 | $this->default_value = '"' . $this->default_value . '"'; |
69 | 69 | } |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | */ |
80 | 80 | function getExpressionString() |
81 | 81 | { |
82 | - if($this->argument) |
|
82 | + if ($this->argument) |
|
83 | 83 | { |
84 | 84 | return sprintf('new UpdateExpression(\'%s\', ${\'%s_argument\'})' |
85 | 85 | , $this->name |
@@ -41,14 +41,12 @@ discard block |
||
41 | 41 | if($column->attrs->var) |
42 | 42 | { |
43 | 43 | $this->argument = new QueryArgument($column); |
44 | - } |
|
45 | - else |
|
44 | + } else |
|
46 | 45 | { |
47 | 46 | if(strpos($column->attrs->default, '.') !== FALSE) |
48 | 47 | { |
49 | 48 | $this->default_value = "'" . $dbParser->parseColumnName($column->attrs->default) . "'"; |
50 | - } |
|
51 | - else |
|
49 | + } else |
|
52 | 50 | { |
53 | 51 | $default_value = new DefaultValue($this->name, $column->attrs->default); |
54 | 52 | if($default_value->isOperation()) |
@@ -84,8 +82,7 @@ discard block |
||
84 | 82 | return sprintf('new UpdateExpression(\'%s\', ${\'%s_argument\'})' |
85 | 83 | , $this->name |
86 | 84 | , $this->argument->argument_name); |
87 | - } |
|
88 | - else |
|
85 | + } else |
|
89 | 86 | { |
90 | 87 | return sprintf('new UpdateExpressionWithoutArgument(\'%s\', %s)' |
91 | 88 | , $this->name |
@@ -28,14 +28,14 @@ discard block |
||
28 | 28 | { |
29 | 29 | $this->columns = array(); |
30 | 30 | |
31 | - if(!is_array($xml_columns)) |
|
31 | + if (!is_array($xml_columns)) |
|
32 | 32 | { |
33 | 33 | $xml_columns = array($xml_columns); |
34 | 34 | } |
35 | 35 | |
36 | - foreach($xml_columns as $column) |
|
36 | + foreach ($xml_columns as $column) |
|
37 | 37 | { |
38 | - if($column->name === 'query') |
|
38 | + if ($column->name === 'query') |
|
39 | 39 | { |
40 | 40 | $this->columns[] = new QueryTag($column, true); |
41 | 41 | } |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | function toString() |
55 | 55 | { |
56 | 56 | $output_columns = 'array(' . PHP_EOL; |
57 | - foreach($this->columns as $column) |
|
57 | + foreach ($this->columns as $column) |
|
58 | 58 | { |
59 | 59 | $output_columns .= $column->getExpressionString() . PHP_EOL . ','; |
60 | 60 | } |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | function getArguments() |
72 | 72 | { |
73 | 73 | $arguments = array(); |
74 | - foreach($this->columns as $column) |
|
74 | + foreach ($this->columns as $column) |
|
75 | 75 | { |
76 | 76 | $arguments[] = $column->getArgument(); |
77 | 77 | } |
@@ -38,8 +38,7 @@ |
||
38 | 38 | if($column->name === 'query') |
39 | 39 | { |
40 | 40 | $this->columns[] = new QueryTag($column, true); |
41 | - } |
|
42 | - else |
|
41 | + } else |
|
43 | 42 | { |
44 | 43 | $this->columns[] = new UpdateColumnTag($column); |
45 | 44 | } |
@@ -33,12 +33,12 @@ discard block |
||
33 | 33 | { |
34 | 34 | $this->pipe = $pipe; |
35 | 35 | |
36 | - if(!is_array($conditions)) |
|
36 | + if (!is_array($conditions)) |
|
37 | 37 | { |
38 | 38 | $conditions = array($conditions); |
39 | 39 | } |
40 | 40 | |
41 | - foreach($conditions as $condition) |
|
41 | + foreach ($conditions as $condition) |
|
42 | 42 | { |
43 | 43 | //if($condition->node_name === 'query') $this->conditions[] = new QueryTag($condition, true); |
44 | 44 | $this->conditions[] = new ConditionTag($condition); |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | function getConditionGroupString() |
58 | 58 | { |
59 | 59 | $conditions_string = 'array(' . PHP_EOL; |
60 | - foreach($this->conditions as $condition) |
|
60 | + foreach ($this->conditions as $condition) |
|
61 | 61 | { |
62 | 62 | $conditions_string .= $condition->getConditionString() . PHP_EOL . ','; |
63 | 63 | } |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | function getArguments() |
71 | 71 | { |
72 | 72 | $arguments = array(); |
73 | - foreach($this->conditions as $condition) |
|
73 | + foreach ($this->conditions as $condition) |
|
74 | 74 | { |
75 | 75 | $arguments = array_merge($arguments, $condition->getArguments()); |
76 | 76 | } |
@@ -67,32 +67,32 @@ discard block |
||
67 | 67 | $this->column_name = $dbParser->parseExpression($condition->attrs->column); |
68 | 68 | |
69 | 69 | // If default value is column name, it should be escaped |
70 | - if($isColumnName = (strpos($condition->attrs->default, '.') !== FALSE |
|
70 | + if ($isColumnName = (strpos($condition->attrs->default, '.') !== FALSE |
|
71 | 71 | && strpos($condition->attrs->default, '.') !== 0 |
72 | - && strpos($condition->attrs->default, '%') === FALSE )) |
|
72 | + && strpos($condition->attrs->default, '%') === FALSE)) |
|
73 | 73 | { |
74 | 74 | $condition->attrs->default = $dbParser->parseExpression($condition->attrs->default); |
75 | 75 | } |
76 | 76 | |
77 | - if($condition->node_name == 'query') |
|
77 | + if ($condition->node_name == 'query') |
|
78 | 78 | { |
79 | 79 | $this->query = new QueryTag($condition, TRUE); |
80 | 80 | $this->default_column = $this->query->toString(); |
81 | 81 | } |
82 | - else if($condition->attrs->var && !strpos($condition->attrs->var, '.')) |
|
82 | + else if ($condition->attrs->var && !strpos($condition->attrs->var, '.')) |
|
83 | 83 | { |
84 | 84 | $this->argument = new QueryArgument($condition); |
85 | 85 | $this->argument_name = $this->argument->getArgumentName(); |
86 | 86 | } |
87 | 87 | else |
88 | 88 | { |
89 | - if(isset($condition->attrs->default)) |
|
89 | + if (isset($condition->attrs->default)) |
|
90 | 90 | { |
91 | 91 | $operationList = array('in' => 1, 'between' => 1, 'notin' => 1, 'not_in' => 1); |
92 | - if(isset($operationList[$this->operation])) |
|
92 | + if (isset($operationList[$this->operation])) |
|
93 | 93 | { |
94 | 94 | $default_value = $condition->attrs->default; |
95 | - if(strpos($default_value, "'") !== FALSE) |
|
95 | + if (strpos($default_value, "'") !== FALSE) |
|
96 | 96 | { |
97 | 97 | $default_value = "\"" . $default_value . "\""; |
98 | 98 | } |
@@ -106,14 +106,14 @@ discard block |
||
106 | 106 | $default_value_object = new DefaultValue($this->column_name, $condition->attrs->default); |
107 | 107 | $default_value = $default_value_object->toString(); |
108 | 108 | |
109 | - if($default_value_object->isStringFromFunction()) |
|
109 | + if ($default_value_object->isStringFromFunction()) |
|
110 | 110 | { |
111 | 111 | $default_value = '"\'".' . $default_value . '."\'"'; |
112 | 112 | } |
113 | 113 | |
114 | - if($default_value_object->isString() && !$isColumnName && !is_numeric($condition->attrs->default)) |
|
114 | + if ($default_value_object->isString() && !$isColumnName && !is_numeric($condition->attrs->default)) |
|
115 | 115 | { |
116 | - if(strpos($default_value, "'") !== FALSE) |
|
116 | + if (strpos($default_value, "'") !== FALSE) |
|
117 | 117 | { |
118 | 118 | $default_value = "\"" . $default_value . "\""; |
119 | 119 | } |
@@ -140,11 +140,11 @@ discard block |
||
140 | 140 | function getArguments() |
141 | 141 | { |
142 | 142 | $arguments = array(); |
143 | - if($this->query) |
|
143 | + if ($this->query) |
|
144 | 144 | { |
145 | 145 | $arguments = array_merge($arguments, $this->query->getArguments()); |
146 | 146 | } |
147 | - if($this->argument) |
|
147 | + if ($this->argument) |
|
148 | 148 | { |
149 | 149 | $arguments[] = $this->argument; |
150 | 150 | } |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | |
154 | 154 | function getConditionString() |
155 | 155 | { |
156 | - if($this->query) |
|
156 | + if ($this->query) |
|
157 | 157 | { |
158 | 158 | return sprintf("new ConditionSubquery('%s',%s,%s%s)" |
159 | 159 | , $this->column_name |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | , $this->pipe ? ", '" . $this->pipe . "'" : '' |
163 | 163 | ); |
164 | 164 | } |
165 | - else if(isset($this->default_column)) |
|
165 | + else if (isset($this->default_column)) |
|
166 | 166 | { |
167 | 167 | return sprintf("new ConditionWithoutArgument('%s',%s,%s%s)" |
168 | 168 | , $this->column_name |
@@ -78,13 +78,11 @@ discard block |
||
78 | 78 | { |
79 | 79 | $this->query = new QueryTag($condition, TRUE); |
80 | 80 | $this->default_column = $this->query->toString(); |
81 | - } |
|
82 | - else if($condition->attrs->var && !strpos($condition->attrs->var, '.')) |
|
81 | + } else if($condition->attrs->var && !strpos($condition->attrs->var, '.')) |
|
83 | 82 | { |
84 | 83 | $this->argument = new QueryArgument($condition); |
85 | 84 | $this->argument_name = $this->argument->getArgumentName(); |
86 | - } |
|
87 | - else |
|
85 | + } else |
|
88 | 86 | { |
89 | 87 | if(isset($condition->attrs->default)) |
90 | 88 | { |
@@ -95,13 +93,11 @@ discard block |
||
95 | 93 | if(strpos($default_value, "'") !== FALSE) |
96 | 94 | { |
97 | 95 | $default_value = "\"" . $default_value . "\""; |
98 | - } |
|
99 | - else |
|
96 | + } else |
|
100 | 97 | { |
101 | 98 | $default_value = "'" . $default_value . "'"; |
102 | 99 | } |
103 | - } |
|
104 | - else |
|
100 | + } else |
|
105 | 101 | { |
106 | 102 | $default_value_object = new DefaultValue($this->column_name, $condition->attrs->default); |
107 | 103 | $default_value = $default_value_object->toString(); |
@@ -116,16 +112,14 @@ discard block |
||
116 | 112 | if(strpos($default_value, "'") !== FALSE) |
117 | 113 | { |
118 | 114 | $default_value = "\"" . $default_value . "\""; |
119 | - } |
|
120 | - else |
|
115 | + } else |
|
121 | 116 | { |
122 | 117 | $default_value = "'" . $default_value . "'"; |
123 | 118 | } |
124 | 119 | } |
125 | 120 | } |
126 | 121 | $this->default_column = $default_value; |
127 | - } |
|
128 | - else |
|
122 | + } else |
|
129 | 123 | { |
130 | 124 | $this->default_column = "'" . $dbParser->parseColumnName($condition->attrs->var) . "'"; |
131 | 125 | } |
@@ -161,8 +155,7 @@ discard block |
||
161 | 155 | , '"' . $this->operation . '"' |
162 | 156 | , $this->pipe ? ", '" . $this->pipe . "'" : '' |
163 | 157 | ); |
164 | - } |
|
165 | - else if(isset($this->default_column)) |
|
158 | + } else if(isset($this->default_column)) |
|
166 | 159 | { |
167 | 160 | return sprintf("new ConditionWithoutArgument('%s',%s,%s%s)" |
168 | 161 | , $this->column_name |
@@ -170,8 +163,7 @@ discard block |
||
170 | 163 | , '"' . $this->operation . '"' |
171 | 164 | , $this->pipe ? ", '" . $this->pipe . "'" : '' |
172 | 165 | ); |
173 | - } |
|
174 | - else |
|
166 | + } else |
|
175 | 167 | { |
176 | 168 | return sprintf("new ConditionWithArgument('%s',%s,%s%s)" |
177 | 169 | , $this->column_name |
@@ -25,42 +25,42 @@ discard block |
||
25 | 25 | function ConditionsTag($xml_conditions) |
26 | 26 | { |
27 | 27 | $this->condition_groups = array(); |
28 | - if(!$xml_conditions) |
|
28 | + if (!$xml_conditions) |
|
29 | 29 | { |
30 | 30 | return; |
31 | 31 | } |
32 | 32 | |
33 | 33 | $xml_condition_list = array(); |
34 | - if($xml_conditions->condition) |
|
34 | + if ($xml_conditions->condition) |
|
35 | 35 | { |
36 | 36 | $xml_condition_list = $xml_conditions->condition; |
37 | 37 | } |
38 | 38 | |
39 | - if($xml_conditions->query) |
|
39 | + if ($xml_conditions->query) |
|
40 | 40 | { |
41 | - if(!is_array($xml_condition_list)) |
|
41 | + if (!is_array($xml_condition_list)) |
|
42 | 42 | { |
43 | 43 | $xml_condition_list = array($xml_condition_list); |
44 | 44 | } |
45 | - if(!is_array($xml_conditions->query)) |
|
45 | + if (!is_array($xml_conditions->query)) |
|
46 | 46 | { |
47 | 47 | $xml_conditions->query = array($xml_conditions->query); |
48 | 48 | } |
49 | 49 | $xml_condition_list = array_merge($xml_condition_list, $xml_conditions->query); |
50 | 50 | } |
51 | - if($xml_condition_list) |
|
51 | + if ($xml_condition_list) |
|
52 | 52 | { |
53 | 53 | $this->condition_groups[] = new ConditionGroupTag($xml_condition_list); |
54 | 54 | } |
55 | 55 | |
56 | 56 | $xml_groups = $xml_conditions->group; |
57 | - if($xml_groups) |
|
57 | + if ($xml_groups) |
|
58 | 58 | { |
59 | - if(!is_array($xml_groups)) |
|
59 | + if (!is_array($xml_groups)) |
|
60 | 60 | { |
61 | 61 | $xml_groups = array($xml_groups); |
62 | 62 | } |
63 | - foreach($xml_groups as $group) |
|
63 | + foreach ($xml_groups as $group) |
|
64 | 64 | { |
65 | 65 | $this->condition_groups[] = new ConditionGroupTag($group->condition, $group->attrs->pipe); |
66 | 66 | } |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | function toString() |
75 | 75 | { |
76 | 76 | $output_conditions = 'array(' . PHP_EOL; |
77 | - foreach($this->condition_groups as $condition) |
|
77 | + foreach ($this->condition_groups as $condition) |
|
78 | 78 | { |
79 | 79 | $output_conditions .= $condition->getConditionGroupString() . PHP_EOL . ','; |
80 | 80 | } |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | function getArguments() |
87 | 87 | { |
88 | 88 | $arguments = array(); |
89 | - foreach($this->condition_groups as $condition) |
|
89 | + foreach ($this->condition_groups as $condition) |
|
90 | 90 | { |
91 | 91 | $arguments = array_merge($arguments, $condition->getArguments()); |
92 | 92 | } |
@@ -26,19 +26,19 @@ discard block |
||
26 | 26 | { |
27 | 27 | $this->groups = array(); |
28 | 28 | |
29 | - if($xml_groups) |
|
29 | + if ($xml_groups) |
|
30 | 30 | { |
31 | - if(!is_array($xml_groups)) |
|
31 | + if (!is_array($xml_groups)) |
|
32 | 32 | { |
33 | 33 | $xml_groups = array($xml_groups); |
34 | 34 | } |
35 | 35 | |
36 | 36 | $dbParser = &DB::getParser(); |
37 | - for($i = 0; $i < count($xml_groups); $i++) |
|
37 | + for ($i = 0; $i < count($xml_groups); $i++) |
|
38 | 38 | { |
39 | 39 | $group = $xml_groups[$i]; |
40 | 40 | $column = trim($group->attrs->column); |
41 | - if(!$column) |
|
41 | + if (!$column) |
|
42 | 42 | { |
43 | 43 | continue; |
44 | 44 | } |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | function toString() |
53 | 53 | { |
54 | 54 | $output = 'array(' . PHP_EOL; |
55 | - foreach($this->groups as $group) |
|
55 | + foreach ($this->groups as $group) |
|
56 | 56 | { |
57 | 57 | $output .= "'" . $group . "' ,"; |
58 | 58 | } |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | // Sort order - asc / desc |
60 | 60 | $this->sort_order = $index->attrs->order; |
61 | 61 | $sortList = array('asc' => 1, 'desc' => 1); |
62 | - if(!isset($sortList[$this->sort_order])) |
|
62 | + if (!isset($sortList[$this->sort_order])) |
|
63 | 63 | { |
64 | 64 | $arg = new Xml_Node_(); |
65 | 65 | $arg->attrs = new Xml_Node_(); |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | { |
84 | 84 | $arguments = array(); |
85 | 85 | $arguments[] = $this->argument; |
86 | - if($this->sort_order_argument) |
|
86 | + if ($this->sort_order_argument) |
|
87 | 87 | { |
88 | 88 | $arguments[] = $this->sort_order_argument; |
89 | 89 | } |
@@ -111,8 +111,7 @@ |
||
111 | 111 | if($this->limit) |
112 | 112 | { |
113 | 113 | return $this->limit->toString(); |
114 | - } |
|
115 | - else |
|
114 | + } else |
|
116 | 115 | { |
117 | 116 | return ""; |
118 | 117 | } |
@@ -42,11 +42,11 @@ discard block |
||
42 | 42 | */ |
43 | 43 | function LimitTag($index) |
44 | 44 | { |
45 | - if($index->page && $index->page->attrs && $index->page_count && $index->page_count->attrs) |
|
45 | + if ($index->page && $index->page->attrs && $index->page_count && $index->page_count->attrs) |
|
46 | 46 | { |
47 | - if(!isset($index->page->attrs->default)) |
|
47 | + if (!isset($index->page->attrs->default)) |
|
48 | 48 | $index->page->attrs->default = 1; |
49 | - if(!isset($index->page_count->attrs->default)) |
|
49 | + if (!isset($index->page_count->attrs->default)) |
|
50 | 50 | $index->page_count->attrs->default = 10; |
51 | 51 | $this->page = new QueryArgument($index->page); |
52 | 52 | $this->page_count = new QueryArgument($index->page_count); |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | $this->arguments[] = $this->page_count; |
55 | 55 | } |
56 | 56 | |
57 | - if(!isset($index->list_count->attrs->default)) |
|
57 | + if (!isset($index->list_count->attrs->default)) |
|
58 | 58 | $index->list_count->attrs->default = 0; |
59 | 59 | $this->list_count = new QueryArgument($index->list_count); |
60 | 60 | $this->arguments[] = $this->list_count; |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | |
63 | 63 | function toString() |
64 | 64 | { |
65 | - if($this->page) |
|
65 | + if ($this->page) |
|
66 | 66 | { |
67 | 67 | return sprintf('new Limit(${\'%s_argument\'}, ${\'%s_argument\'}, ${\'%s_argument\'})', $this->list_count->getArgumentName(), $this->page->getArgumentName(), $this->page_count->getArgumentName()); |
68 | 68 | } |
@@ -44,18 +44,21 @@ discard block |
||
44 | 44 | { |
45 | 45 | if($index->page && $index->page->attrs && $index->page_count && $index->page_count->attrs) |
46 | 46 | { |
47 | - if(!isset($index->page->attrs->default)) |
|
48 | - $index->page->attrs->default = 1; |
|
49 | - if(!isset($index->page_count->attrs->default)) |
|
50 | - $index->page_count->attrs->default = 10; |
|
47 | + if(!isset($index->page->attrs->default)) { |
|
48 | + $index->page->attrs->default = 1; |
|
49 | + } |
|
50 | + if(!isset($index->page_count->attrs->default)) { |
|
51 | + $index->page_count->attrs->default = 10; |
|
52 | + } |
|
51 | 53 | $this->page = new QueryArgument($index->page); |
52 | 54 | $this->page_count = new QueryArgument($index->page_count); |
53 | 55 | $this->arguments[] = $this->page; |
54 | 56 | $this->arguments[] = $this->page_count; |
55 | 57 | } |
56 | 58 | |
57 | - if(!isset($index->list_count->attrs->default)) |
|
58 | - $index->list_count->attrs->default = 0; |
|
59 | + if(!isset($index->list_count->attrs->default)) { |
|
60 | + $index->list_count->attrs->default = 0; |
|
61 | + } |
|
59 | 62 | $this->list_count = new QueryArgument($index->list_count); |
60 | 63 | $this->arguments[] = $this->list_count; |
61 | 64 | } |
@@ -65,8 +68,7 @@ discard block |
||
65 | 68 | if($this->page) |
66 | 69 | { |
67 | 70 | return sprintf('new Limit(${\'%s_argument\'}, ${\'%s_argument\'}, ${\'%s_argument\'})', $this->list_count->getArgumentName(), $this->page->getArgumentName(), $this->page_count->getArgumentName()); |
68 | - } |
|
69 | - else |
|
71 | + } else |
|
70 | 72 | { |
71 | 73 | return sprintf('new Limit(${\'%s_argument\'})', $this->list_count->getArgumentName()); |
72 | 74 | } |