@@ -31,224 +31,224 @@ |
||
31 | 31 | */ |
32 | 32 | abstract class Entity { |
33 | 33 | |
34 | - public $id; |
|
34 | + public $id; |
|
35 | 35 | |
36 | - private $_updatedFields = array(); |
|
37 | - private $_fieldTypes = array('id' => 'integer'); |
|
36 | + private $_updatedFields = array(); |
|
37 | + private $_fieldTypes = array('id' => 'integer'); |
|
38 | 38 | |
39 | 39 | |
40 | - /** |
|
41 | - * Simple alternative constructor for building entities from a request |
|
42 | - * @param array $params the array which was obtained via $this->params('key') |
|
43 | - * in the controller |
|
44 | - * @return Entity |
|
45 | - * @since 7.0.0 |
|
46 | - */ |
|
47 | - public static function fromParams(array $params) { |
|
48 | - $instance = new static(); |
|
40 | + /** |
|
41 | + * Simple alternative constructor for building entities from a request |
|
42 | + * @param array $params the array which was obtained via $this->params('key') |
|
43 | + * in the controller |
|
44 | + * @return Entity |
|
45 | + * @since 7.0.0 |
|
46 | + */ |
|
47 | + public static function fromParams(array $params) { |
|
48 | + $instance = new static(); |
|
49 | 49 | |
50 | - foreach($params as $key => $value) { |
|
51 | - $method = 'set' . ucfirst($key); |
|
52 | - $instance->$method($value); |
|
53 | - } |
|
50 | + foreach($params as $key => $value) { |
|
51 | + $method = 'set' . ucfirst($key); |
|
52 | + $instance->$method($value); |
|
53 | + } |
|
54 | 54 | |
55 | - return $instance; |
|
56 | - } |
|
55 | + return $instance; |
|
56 | + } |
|
57 | 57 | |
58 | 58 | |
59 | - /** |
|
60 | - * Maps the keys of the row array to the attributes |
|
61 | - * @param array $row the row to map onto the entity |
|
62 | - * @since 7.0.0 |
|
63 | - */ |
|
64 | - public static function fromRow(array $row){ |
|
65 | - $instance = new static(); |
|
59 | + /** |
|
60 | + * Maps the keys of the row array to the attributes |
|
61 | + * @param array $row the row to map onto the entity |
|
62 | + * @since 7.0.0 |
|
63 | + */ |
|
64 | + public static function fromRow(array $row){ |
|
65 | + $instance = new static(); |
|
66 | 66 | |
67 | - foreach($row as $key => $value){ |
|
68 | - $prop = ucfirst($instance->columnToProperty($key)); |
|
69 | - $setter = 'set' . $prop; |
|
70 | - $instance->$setter($value); |
|
71 | - } |
|
67 | + foreach($row as $key => $value){ |
|
68 | + $prop = ucfirst($instance->columnToProperty($key)); |
|
69 | + $setter = 'set' . $prop; |
|
70 | + $instance->$setter($value); |
|
71 | + } |
|
72 | 72 | |
73 | - $instance->resetUpdatedFields(); |
|
73 | + $instance->resetUpdatedFields(); |
|
74 | 74 | |
75 | - return $instance; |
|
76 | - } |
|
75 | + return $instance; |
|
76 | + } |
|
77 | 77 | |
78 | 78 | |
79 | - /** |
|
80 | - * @return array with attribute and type |
|
81 | - * @since 7.0.0 |
|
82 | - */ |
|
83 | - public function getFieldTypes() { |
|
84 | - return $this->_fieldTypes; |
|
85 | - } |
|
79 | + /** |
|
80 | + * @return array with attribute and type |
|
81 | + * @since 7.0.0 |
|
82 | + */ |
|
83 | + public function getFieldTypes() { |
|
84 | + return $this->_fieldTypes; |
|
85 | + } |
|
86 | 86 | |
87 | 87 | |
88 | - /** |
|
89 | - * Marks the entity as clean needed for setting the id after the insertion |
|
90 | - * @since 7.0.0 |
|
91 | - */ |
|
92 | - public function resetUpdatedFields(){ |
|
93 | - $this->_updatedFields = array(); |
|
94 | - } |
|
95 | - |
|
96 | - /** |
|
97 | - * Generic setter for properties |
|
98 | - * @since 7.0.0 |
|
99 | - */ |
|
100 | - protected function setter($name, $args) { |
|
101 | - // setters should only work for existing attributes |
|
102 | - if(property_exists($this, $name)){ |
|
103 | - if($this->$name === $args[0]) { |
|
104 | - return; |
|
105 | - } |
|
106 | - $this->markFieldUpdated($name); |
|
107 | - |
|
108 | - // if type definition exists, cast to correct type |
|
109 | - if($args[0] !== null && array_key_exists($name, $this->_fieldTypes)) { |
|
110 | - settype($args[0], $this->_fieldTypes[$name]); |
|
111 | - } |
|
112 | - $this->$name = $args[0]; |
|
113 | - |
|
114 | - } else { |
|
115 | - throw new \BadFunctionCallException($name . |
|
116 | - ' is not a valid attribute'); |
|
117 | - } |
|
118 | - } |
|
119 | - |
|
120 | - /** |
|
121 | - * Generic getter for properties |
|
122 | - * @since 7.0.0 |
|
123 | - */ |
|
124 | - protected function getter($name) { |
|
125 | - // getters should only work for existing attributes |
|
126 | - if(property_exists($this, $name)){ |
|
127 | - return $this->$name; |
|
128 | - } else { |
|
129 | - throw new \BadFunctionCallException($name . |
|
130 | - ' is not a valid attribute'); |
|
131 | - } |
|
132 | - } |
|
133 | - |
|
134 | - |
|
135 | - /** |
|
136 | - * Each time a setter is called, push the part after set |
|
137 | - * into an array: for instance setId will save Id in the |
|
138 | - * updated fields array so it can be easily used to create the |
|
139 | - * getter method |
|
140 | - * @since 7.0.0 |
|
141 | - */ |
|
142 | - public function __call($methodName, $args){ |
|
143 | - $attr = lcfirst( substr($methodName, 3) ); |
|
144 | - |
|
145 | - if(strpos($methodName, 'set') === 0){ |
|
146 | - $this->setter($attr, $args); |
|
147 | - } elseif(strpos($methodName, 'get') === 0) { |
|
148 | - return $this->getter($attr); |
|
149 | - } else { |
|
150 | - throw new \BadFunctionCallException($methodName . |
|
151 | - ' does not exist'); |
|
152 | - } |
|
153 | - |
|
154 | - } |
|
155 | - |
|
156 | - |
|
157 | - /** |
|
158 | - * Mark am attribute as updated |
|
159 | - * @param string $attribute the name of the attribute |
|
160 | - * @since 7.0.0 |
|
161 | - */ |
|
162 | - protected function markFieldUpdated($attribute){ |
|
163 | - $this->_updatedFields[$attribute] = true; |
|
164 | - } |
|
165 | - |
|
166 | - |
|
167 | - /** |
|
168 | - * Transform a database columnname to a property |
|
169 | - * @param string $columnName the name of the column |
|
170 | - * @return string the property name |
|
171 | - * @since 7.0.0 |
|
172 | - */ |
|
173 | - public function columnToProperty($columnName){ |
|
174 | - $parts = explode('_', $columnName); |
|
175 | - $property = null; |
|
176 | - |
|
177 | - foreach($parts as $part){ |
|
178 | - if($property === null){ |
|
179 | - $property = $part; |
|
180 | - } else { |
|
181 | - $property .= ucfirst($part); |
|
182 | - } |
|
183 | - } |
|
184 | - |
|
185 | - return $property; |
|
186 | - } |
|
187 | - |
|
188 | - |
|
189 | - /** |
|
190 | - * Transform a property to a database column name |
|
191 | - * @param string $property the name of the property |
|
192 | - * @return string the column name |
|
193 | - * @since 7.0.0 |
|
194 | - */ |
|
195 | - public function propertyToColumn($property){ |
|
196 | - $parts = preg_split('/(?=[A-Z])/', $property); |
|
197 | - $column = null; |
|
198 | - |
|
199 | - foreach($parts as $part){ |
|
200 | - if($column === null){ |
|
201 | - $column = $part; |
|
202 | - } else { |
|
203 | - $column .= '_' . lcfirst($part); |
|
204 | - } |
|
205 | - } |
|
206 | - |
|
207 | - return $column; |
|
208 | - } |
|
209 | - |
|
210 | - |
|
211 | - /** |
|
212 | - * @return array array of updated fields for update query |
|
213 | - * @since 7.0.0 |
|
214 | - */ |
|
215 | - public function getUpdatedFields(){ |
|
216 | - return $this->_updatedFields; |
|
217 | - } |
|
218 | - |
|
219 | - |
|
220 | - /** |
|
221 | - * Adds type information for a field so that its automatically casted to |
|
222 | - * that value once its being returned from the database |
|
223 | - * @param string $fieldName the name of the attribute |
|
224 | - * @param string $type the type which will be used to call settype() |
|
225 | - * @since 7.0.0 |
|
226 | - */ |
|
227 | - protected function addType($fieldName, $type){ |
|
228 | - $this->_fieldTypes[$fieldName] = $type; |
|
229 | - } |
|
230 | - |
|
231 | - |
|
232 | - /** |
|
233 | - * Slugify the value of a given attribute |
|
234 | - * Warning: This doesn't result in a unique value |
|
235 | - * @param string $attributeName the name of the attribute, which value should be slugified |
|
236 | - * @return string slugified value |
|
237 | - * @since 7.0.0 |
|
238 | - */ |
|
239 | - public function slugify($attributeName){ |
|
240 | - // toSlug should only work for existing attributes |
|
241 | - if(property_exists($this, $attributeName)){ |
|
242 | - $value = $this->$attributeName; |
|
243 | - // replace everything except alphanumeric with a single '-' |
|
244 | - $value = preg_replace('/[^A-Za-z0-9]+/', '-', $value); |
|
245 | - $value = strtolower($value); |
|
246 | - // trim '-' |
|
247 | - return trim($value, '-'); |
|
248 | - } else { |
|
249 | - throw new \BadFunctionCallException($attributeName . |
|
250 | - ' is not a valid attribute'); |
|
251 | - } |
|
252 | - } |
|
88 | + /** |
|
89 | + * Marks the entity as clean needed for setting the id after the insertion |
|
90 | + * @since 7.0.0 |
|
91 | + */ |
|
92 | + public function resetUpdatedFields(){ |
|
93 | + $this->_updatedFields = array(); |
|
94 | + } |
|
95 | + |
|
96 | + /** |
|
97 | + * Generic setter for properties |
|
98 | + * @since 7.0.0 |
|
99 | + */ |
|
100 | + protected function setter($name, $args) { |
|
101 | + // setters should only work for existing attributes |
|
102 | + if(property_exists($this, $name)){ |
|
103 | + if($this->$name === $args[0]) { |
|
104 | + return; |
|
105 | + } |
|
106 | + $this->markFieldUpdated($name); |
|
107 | + |
|
108 | + // if type definition exists, cast to correct type |
|
109 | + if($args[0] !== null && array_key_exists($name, $this->_fieldTypes)) { |
|
110 | + settype($args[0], $this->_fieldTypes[$name]); |
|
111 | + } |
|
112 | + $this->$name = $args[0]; |
|
113 | + |
|
114 | + } else { |
|
115 | + throw new \BadFunctionCallException($name . |
|
116 | + ' is not a valid attribute'); |
|
117 | + } |
|
118 | + } |
|
119 | + |
|
120 | + /** |
|
121 | + * Generic getter for properties |
|
122 | + * @since 7.0.0 |
|
123 | + */ |
|
124 | + protected function getter($name) { |
|
125 | + // getters should only work for existing attributes |
|
126 | + if(property_exists($this, $name)){ |
|
127 | + return $this->$name; |
|
128 | + } else { |
|
129 | + throw new \BadFunctionCallException($name . |
|
130 | + ' is not a valid attribute'); |
|
131 | + } |
|
132 | + } |
|
133 | + |
|
134 | + |
|
135 | + /** |
|
136 | + * Each time a setter is called, push the part after set |
|
137 | + * into an array: for instance setId will save Id in the |
|
138 | + * updated fields array so it can be easily used to create the |
|
139 | + * getter method |
|
140 | + * @since 7.0.0 |
|
141 | + */ |
|
142 | + public function __call($methodName, $args){ |
|
143 | + $attr = lcfirst( substr($methodName, 3) ); |
|
144 | + |
|
145 | + if(strpos($methodName, 'set') === 0){ |
|
146 | + $this->setter($attr, $args); |
|
147 | + } elseif(strpos($methodName, 'get') === 0) { |
|
148 | + return $this->getter($attr); |
|
149 | + } else { |
|
150 | + throw new \BadFunctionCallException($methodName . |
|
151 | + ' does not exist'); |
|
152 | + } |
|
153 | + |
|
154 | + } |
|
155 | + |
|
156 | + |
|
157 | + /** |
|
158 | + * Mark am attribute as updated |
|
159 | + * @param string $attribute the name of the attribute |
|
160 | + * @since 7.0.0 |
|
161 | + */ |
|
162 | + protected function markFieldUpdated($attribute){ |
|
163 | + $this->_updatedFields[$attribute] = true; |
|
164 | + } |
|
165 | + |
|
166 | + |
|
167 | + /** |
|
168 | + * Transform a database columnname to a property |
|
169 | + * @param string $columnName the name of the column |
|
170 | + * @return string the property name |
|
171 | + * @since 7.0.0 |
|
172 | + */ |
|
173 | + public function columnToProperty($columnName){ |
|
174 | + $parts = explode('_', $columnName); |
|
175 | + $property = null; |
|
176 | + |
|
177 | + foreach($parts as $part){ |
|
178 | + if($property === null){ |
|
179 | + $property = $part; |
|
180 | + } else { |
|
181 | + $property .= ucfirst($part); |
|
182 | + } |
|
183 | + } |
|
184 | + |
|
185 | + return $property; |
|
186 | + } |
|
187 | + |
|
188 | + |
|
189 | + /** |
|
190 | + * Transform a property to a database column name |
|
191 | + * @param string $property the name of the property |
|
192 | + * @return string the column name |
|
193 | + * @since 7.0.0 |
|
194 | + */ |
|
195 | + public function propertyToColumn($property){ |
|
196 | + $parts = preg_split('/(?=[A-Z])/', $property); |
|
197 | + $column = null; |
|
198 | + |
|
199 | + foreach($parts as $part){ |
|
200 | + if($column === null){ |
|
201 | + $column = $part; |
|
202 | + } else { |
|
203 | + $column .= '_' . lcfirst($part); |
|
204 | + } |
|
205 | + } |
|
206 | + |
|
207 | + return $column; |
|
208 | + } |
|
209 | + |
|
210 | + |
|
211 | + /** |
|
212 | + * @return array array of updated fields for update query |
|
213 | + * @since 7.0.0 |
|
214 | + */ |
|
215 | + public function getUpdatedFields(){ |
|
216 | + return $this->_updatedFields; |
|
217 | + } |
|
218 | + |
|
219 | + |
|
220 | + /** |
|
221 | + * Adds type information for a field so that its automatically casted to |
|
222 | + * that value once its being returned from the database |
|
223 | + * @param string $fieldName the name of the attribute |
|
224 | + * @param string $type the type which will be used to call settype() |
|
225 | + * @since 7.0.0 |
|
226 | + */ |
|
227 | + protected function addType($fieldName, $type){ |
|
228 | + $this->_fieldTypes[$fieldName] = $type; |
|
229 | + } |
|
230 | + |
|
231 | + |
|
232 | + /** |
|
233 | + * Slugify the value of a given attribute |
|
234 | + * Warning: This doesn't result in a unique value |
|
235 | + * @param string $attributeName the name of the attribute, which value should be slugified |
|
236 | + * @return string slugified value |
|
237 | + * @since 7.0.0 |
|
238 | + */ |
|
239 | + public function slugify($attributeName){ |
|
240 | + // toSlug should only work for existing attributes |
|
241 | + if(property_exists($this, $attributeName)){ |
|
242 | + $value = $this->$attributeName; |
|
243 | + // replace everything except alphanumeric with a single '-' |
|
244 | + $value = preg_replace('/[^A-Za-z0-9]+/', '-', $value); |
|
245 | + $value = strtolower($value); |
|
246 | + // trim '-' |
|
247 | + return trim($value, '-'); |
|
248 | + } else { |
|
249 | + throw new \BadFunctionCallException($attributeName . |
|
250 | + ' is not a valid attribute'); |
|
251 | + } |
|
252 | + } |
|
253 | 253 | |
254 | 254 | } |
@@ -47,8 +47,8 @@ discard block |
||
47 | 47 | public static function fromParams(array $params) { |
48 | 48 | $instance = new static(); |
49 | 49 | |
50 | - foreach($params as $key => $value) { |
|
51 | - $method = 'set' . ucfirst($key); |
|
50 | + foreach ($params as $key => $value) { |
|
51 | + $method = 'set'.ucfirst($key); |
|
52 | 52 | $instance->$method($value); |
53 | 53 | } |
54 | 54 | |
@@ -61,12 +61,12 @@ discard block |
||
61 | 61 | * @param array $row the row to map onto the entity |
62 | 62 | * @since 7.0.0 |
63 | 63 | */ |
64 | - public static function fromRow(array $row){ |
|
64 | + public static function fromRow(array $row) { |
|
65 | 65 | $instance = new static(); |
66 | 66 | |
67 | - foreach($row as $key => $value){ |
|
67 | + foreach ($row as $key => $value) { |
|
68 | 68 | $prop = ucfirst($instance->columnToProperty($key)); |
69 | - $setter = 'set' . $prop; |
|
69 | + $setter = 'set'.$prop; |
|
70 | 70 | $instance->$setter($value); |
71 | 71 | } |
72 | 72 | |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | * Marks the entity as clean needed for setting the id after the insertion |
90 | 90 | * @since 7.0.0 |
91 | 91 | */ |
92 | - public function resetUpdatedFields(){ |
|
92 | + public function resetUpdatedFields() { |
|
93 | 93 | $this->_updatedFields = array(); |
94 | 94 | } |
95 | 95 | |
@@ -99,20 +99,20 @@ discard block |
||
99 | 99 | */ |
100 | 100 | protected function setter($name, $args) { |
101 | 101 | // setters should only work for existing attributes |
102 | - if(property_exists($this, $name)){ |
|
103 | - if($this->$name === $args[0]) { |
|
102 | + if (property_exists($this, $name)) { |
|
103 | + if ($this->$name === $args[0]) { |
|
104 | 104 | return; |
105 | 105 | } |
106 | 106 | $this->markFieldUpdated($name); |
107 | 107 | |
108 | 108 | // if type definition exists, cast to correct type |
109 | - if($args[0] !== null && array_key_exists($name, $this->_fieldTypes)) { |
|
109 | + if ($args[0] !== null && array_key_exists($name, $this->_fieldTypes)) { |
|
110 | 110 | settype($args[0], $this->_fieldTypes[$name]); |
111 | 111 | } |
112 | 112 | $this->$name = $args[0]; |
113 | 113 | |
114 | 114 | } else { |
115 | - throw new \BadFunctionCallException($name . |
|
115 | + throw new \BadFunctionCallException($name. |
|
116 | 116 | ' is not a valid attribute'); |
117 | 117 | } |
118 | 118 | } |
@@ -123,10 +123,10 @@ discard block |
||
123 | 123 | */ |
124 | 124 | protected function getter($name) { |
125 | 125 | // getters should only work for existing attributes |
126 | - if(property_exists($this, $name)){ |
|
126 | + if (property_exists($this, $name)) { |
|
127 | 127 | return $this->$name; |
128 | 128 | } else { |
129 | - throw new \BadFunctionCallException($name . |
|
129 | + throw new \BadFunctionCallException($name. |
|
130 | 130 | ' is not a valid attribute'); |
131 | 131 | } |
132 | 132 | } |
@@ -139,15 +139,15 @@ discard block |
||
139 | 139 | * getter method |
140 | 140 | * @since 7.0.0 |
141 | 141 | */ |
142 | - public function __call($methodName, $args){ |
|
143 | - $attr = lcfirst( substr($methodName, 3) ); |
|
142 | + public function __call($methodName, $args) { |
|
143 | + $attr = lcfirst(substr($methodName, 3)); |
|
144 | 144 | |
145 | - if(strpos($methodName, 'set') === 0){ |
|
145 | + if (strpos($methodName, 'set') === 0) { |
|
146 | 146 | $this->setter($attr, $args); |
147 | - } elseif(strpos($methodName, 'get') === 0) { |
|
147 | + } elseif (strpos($methodName, 'get') === 0) { |
|
148 | 148 | return $this->getter($attr); |
149 | 149 | } else { |
150 | - throw new \BadFunctionCallException($methodName . |
|
150 | + throw new \BadFunctionCallException($methodName. |
|
151 | 151 | ' does not exist'); |
152 | 152 | } |
153 | 153 | |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | * @param string $attribute the name of the attribute |
160 | 160 | * @since 7.0.0 |
161 | 161 | */ |
162 | - protected function markFieldUpdated($attribute){ |
|
162 | + protected function markFieldUpdated($attribute) { |
|
163 | 163 | $this->_updatedFields[$attribute] = true; |
164 | 164 | } |
165 | 165 | |
@@ -170,12 +170,12 @@ discard block |
||
170 | 170 | * @return string the property name |
171 | 171 | * @since 7.0.0 |
172 | 172 | */ |
173 | - public function columnToProperty($columnName){ |
|
173 | + public function columnToProperty($columnName) { |
|
174 | 174 | $parts = explode('_', $columnName); |
175 | 175 | $property = null; |
176 | 176 | |
177 | - foreach($parts as $part){ |
|
178 | - if($property === null){ |
|
177 | + foreach ($parts as $part) { |
|
178 | + if ($property === null) { |
|
179 | 179 | $property = $part; |
180 | 180 | } else { |
181 | 181 | $property .= ucfirst($part); |
@@ -192,15 +192,15 @@ discard block |
||
192 | 192 | * @return string the column name |
193 | 193 | * @since 7.0.0 |
194 | 194 | */ |
195 | - public function propertyToColumn($property){ |
|
195 | + public function propertyToColumn($property) { |
|
196 | 196 | $parts = preg_split('/(?=[A-Z])/', $property); |
197 | 197 | $column = null; |
198 | 198 | |
199 | - foreach($parts as $part){ |
|
200 | - if($column === null){ |
|
199 | + foreach ($parts as $part) { |
|
200 | + if ($column === null) { |
|
201 | 201 | $column = $part; |
202 | 202 | } else { |
203 | - $column .= '_' . lcfirst($part); |
|
203 | + $column .= '_'.lcfirst($part); |
|
204 | 204 | } |
205 | 205 | } |
206 | 206 | |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | * @return array array of updated fields for update query |
213 | 213 | * @since 7.0.0 |
214 | 214 | */ |
215 | - public function getUpdatedFields(){ |
|
215 | + public function getUpdatedFields() { |
|
216 | 216 | return $this->_updatedFields; |
217 | 217 | } |
218 | 218 | |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | * @param string $type the type which will be used to call settype() |
225 | 225 | * @since 7.0.0 |
226 | 226 | */ |
227 | - protected function addType($fieldName, $type){ |
|
227 | + protected function addType($fieldName, $type) { |
|
228 | 228 | $this->_fieldTypes[$fieldName] = $type; |
229 | 229 | } |
230 | 230 | |
@@ -236,9 +236,9 @@ discard block |
||
236 | 236 | * @return string slugified value |
237 | 237 | * @since 7.0.0 |
238 | 238 | */ |
239 | - public function slugify($attributeName){ |
|
239 | + public function slugify($attributeName) { |
|
240 | 240 | // toSlug should only work for existing attributes |
241 | - if(property_exists($this, $attributeName)){ |
|
241 | + if (property_exists($this, $attributeName)) { |
|
242 | 242 | $value = $this->$attributeName; |
243 | 243 | // replace everything except alphanumeric with a single '-' |
244 | 244 | $value = preg_replace('/[^A-Za-z0-9]+/', '-', $value); |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | // trim '-' |
247 | 247 | return trim($value, '-'); |
248 | 248 | } else { |
249 | - throw new \BadFunctionCallException($attributeName . |
|
249 | + throw new \BadFunctionCallException($attributeName. |
|
250 | 250 | ' is not a valid attribute'); |
251 | 251 | } |
252 | 252 | } |
@@ -33,32 +33,32 @@ |
||
33 | 33 | */ |
34 | 34 | interface IProviderFactory { |
35 | 35 | |
36 | - /** |
|
37 | - * IProviderFactory constructor. |
|
38 | - * @param IServerContainer $serverContainer |
|
39 | - * @since 9.0.0 |
|
40 | - */ |
|
41 | - public function __construct(IServerContainer $serverContainer); |
|
36 | + /** |
|
37 | + * IProviderFactory constructor. |
|
38 | + * @param IServerContainer $serverContainer |
|
39 | + * @since 9.0.0 |
|
40 | + */ |
|
41 | + public function __construct(IServerContainer $serverContainer); |
|
42 | 42 | |
43 | - /** |
|
44 | - * @param string $id |
|
45 | - * @return IShareProvider |
|
46 | - * @throws ProviderException |
|
47 | - * @since 9.0.0 |
|
48 | - */ |
|
49 | - public function getProvider($id); |
|
43 | + /** |
|
44 | + * @param string $id |
|
45 | + * @return IShareProvider |
|
46 | + * @throws ProviderException |
|
47 | + * @since 9.0.0 |
|
48 | + */ |
|
49 | + public function getProvider($id); |
|
50 | 50 | |
51 | - /** |
|
52 | - * @param int $shareType |
|
53 | - * @return IShareProvider |
|
54 | - * @throws ProviderException |
|
55 | - * @since 9.0.0 |
|
56 | - */ |
|
57 | - public function getProviderForType($shareType); |
|
51 | + /** |
|
52 | + * @param int $shareType |
|
53 | + * @return IShareProvider |
|
54 | + * @throws ProviderException |
|
55 | + * @since 9.0.0 |
|
56 | + */ |
|
57 | + public function getProviderForType($shareType); |
|
58 | 58 | |
59 | - /** |
|
60 | - * @return IShareProvider[] |
|
61 | - * @since 11.0.0 |
|
62 | - */ |
|
63 | - public function getAllProviders(); |
|
59 | + /** |
|
60 | + * @return IShareProvider[] |
|
61 | + * @since 11.0.0 |
|
62 | + */ |
|
63 | + public function getAllProviders(); |
|
64 | 64 | } |
@@ -33,65 +33,65 @@ |
||
33 | 33 | */ |
34 | 34 | class SabrePluginEvent extends Event { |
35 | 35 | |
36 | - /** @var int */ |
|
37 | - protected $statusCode; |
|
36 | + /** @var int */ |
|
37 | + protected $statusCode; |
|
38 | 38 | |
39 | - /** @var string */ |
|
40 | - protected $message; |
|
39 | + /** @var string */ |
|
40 | + protected $message; |
|
41 | 41 | |
42 | - /** @var Server */ |
|
43 | - protected $server; |
|
42 | + /** @var Server */ |
|
43 | + protected $server; |
|
44 | 44 | |
45 | - /** |
|
46 | - * @since 8.2.0 |
|
47 | - */ |
|
48 | - public function __construct($server = null) { |
|
49 | - $this->message = ''; |
|
50 | - $this->statusCode = Http::STATUS_OK; |
|
51 | - $this->server = $server; |
|
52 | - } |
|
45 | + /** |
|
46 | + * @since 8.2.0 |
|
47 | + */ |
|
48 | + public function __construct($server = null) { |
|
49 | + $this->message = ''; |
|
50 | + $this->statusCode = Http::STATUS_OK; |
|
51 | + $this->server = $server; |
|
52 | + } |
|
53 | 53 | |
54 | - /** |
|
55 | - * @param int $statusCode |
|
56 | - * @return self |
|
57 | - * @since 8.2.0 |
|
58 | - */ |
|
59 | - public function setStatusCode($statusCode) { |
|
60 | - $this->statusCode = (int) $statusCode; |
|
61 | - return $this; |
|
62 | - } |
|
54 | + /** |
|
55 | + * @param int $statusCode |
|
56 | + * @return self |
|
57 | + * @since 8.2.0 |
|
58 | + */ |
|
59 | + public function setStatusCode($statusCode) { |
|
60 | + $this->statusCode = (int) $statusCode; |
|
61 | + return $this; |
|
62 | + } |
|
63 | 63 | |
64 | - /** |
|
65 | - * @param string $message |
|
66 | - * @return self |
|
67 | - * @since 8.2.0 |
|
68 | - */ |
|
69 | - public function setMessage($message) { |
|
70 | - $this->message = (string) $message; |
|
71 | - return $this; |
|
72 | - } |
|
64 | + /** |
|
65 | + * @param string $message |
|
66 | + * @return self |
|
67 | + * @since 8.2.0 |
|
68 | + */ |
|
69 | + public function setMessage($message) { |
|
70 | + $this->message = (string) $message; |
|
71 | + return $this; |
|
72 | + } |
|
73 | 73 | |
74 | - /** |
|
75 | - * @return int |
|
76 | - * @since 8.2.0 |
|
77 | - */ |
|
78 | - public function getStatusCode() { |
|
79 | - return $this->statusCode; |
|
80 | - } |
|
74 | + /** |
|
75 | + * @return int |
|
76 | + * @since 8.2.0 |
|
77 | + */ |
|
78 | + public function getStatusCode() { |
|
79 | + return $this->statusCode; |
|
80 | + } |
|
81 | 81 | |
82 | - /** |
|
83 | - * @return string |
|
84 | - * @since 8.2.0 |
|
85 | - */ |
|
86 | - public function getMessage() { |
|
87 | - return $this->message; |
|
88 | - } |
|
82 | + /** |
|
83 | + * @return string |
|
84 | + * @since 8.2.0 |
|
85 | + */ |
|
86 | + public function getMessage() { |
|
87 | + return $this->message; |
|
88 | + } |
|
89 | 89 | |
90 | - /** |
|
91 | - * @return null|Server |
|
92 | - * @since 9.0.0 |
|
93 | - */ |
|
94 | - public function getServer() { |
|
95 | - return $this->server; |
|
96 | - } |
|
90 | + /** |
|
91 | + * @return null|Server |
|
92 | + * @since 9.0.0 |
|
93 | + */ |
|
94 | + public function getServer() { |
|
95 | + return $this->server; |
|
96 | + } |
|
97 | 97 | } |
@@ -29,11 +29,11 @@ |
||
29 | 29 | */ |
30 | 30 | interface IValidator { |
31 | 31 | |
32 | - /** |
|
33 | - * @param string $subject |
|
34 | - * @param array[] $parameters |
|
35 | - * @throws InvalidObjectExeption |
|
36 | - * @since 11.0.0 |
|
37 | - */ |
|
38 | - public function validate($subject, array $parameters); |
|
32 | + /** |
|
33 | + * @param string $subject |
|
34 | + * @param array[] $parameters |
|
35 | + * @throws InvalidObjectExeption |
|
36 | + * @since 11.0.0 |
|
37 | + */ |
|
38 | + public function validate($subject, array $parameters); |
|
39 | 39 | } |
@@ -26,9 +26,9 @@ |
||
26 | 26 | * @since 8.2.0 |
27 | 27 | */ |
28 | 28 | interface IQueryFunction { |
29 | - /** |
|
30 | - * @return string |
|
31 | - * @since 8.2.0 |
|
32 | - */ |
|
33 | - public function __toString(); |
|
29 | + /** |
|
30 | + * @return string |
|
31 | + * @since 8.2.0 |
|
32 | + */ |
|
33 | + public function __toString(); |
|
34 | 34 | } |
@@ -26,9 +26,9 @@ |
||
26 | 26 | * @since 8.2.0 |
27 | 27 | */ |
28 | 28 | interface ILiteral { |
29 | - /** |
|
30 | - * @return string |
|
31 | - * @since 8.2.0 |
|
32 | - */ |
|
33 | - public function __toString(); |
|
29 | + /** |
|
30 | + * @return string |
|
31 | + * @since 8.2.0 |
|
32 | + */ |
|
33 | + public function __toString(); |
|
34 | 34 | } |
@@ -28,39 +28,39 @@ |
||
28 | 28 | * @since 8.2.0 |
29 | 29 | */ |
30 | 30 | interface ICompositeExpression { |
31 | - /** |
|
32 | - * Adds multiple parts to composite expression. |
|
33 | - * |
|
34 | - * @param array $parts |
|
35 | - * |
|
36 | - * @return ICompositeExpression |
|
37 | - * @since 8.2.0 |
|
38 | - */ |
|
39 | - public function addMultiple(array $parts = array()); |
|
31 | + /** |
|
32 | + * Adds multiple parts to composite expression. |
|
33 | + * |
|
34 | + * @param array $parts |
|
35 | + * |
|
36 | + * @return ICompositeExpression |
|
37 | + * @since 8.2.0 |
|
38 | + */ |
|
39 | + public function addMultiple(array $parts = array()); |
|
40 | 40 | |
41 | - /** |
|
42 | - * Adds an expression to composite expression. |
|
43 | - * |
|
44 | - * @param mixed $part |
|
45 | - * |
|
46 | - * @return ICompositeExpression |
|
47 | - * @since 8.2.0 |
|
48 | - */ |
|
49 | - public function add($part); |
|
41 | + /** |
|
42 | + * Adds an expression to composite expression. |
|
43 | + * |
|
44 | + * @param mixed $part |
|
45 | + * |
|
46 | + * @return ICompositeExpression |
|
47 | + * @since 8.2.0 |
|
48 | + */ |
|
49 | + public function add($part); |
|
50 | 50 | |
51 | - /** |
|
52 | - * Retrieves the amount of expressions on composite expression. |
|
53 | - * |
|
54 | - * @return integer |
|
55 | - * @since 8.2.0 |
|
56 | - */ |
|
57 | - public function count(); |
|
51 | + /** |
|
52 | + * Retrieves the amount of expressions on composite expression. |
|
53 | + * |
|
54 | + * @return integer |
|
55 | + * @since 8.2.0 |
|
56 | + */ |
|
57 | + public function count(); |
|
58 | 58 | |
59 | - /** |
|
60 | - * Returns the type of this composite expression (AND/OR). |
|
61 | - * |
|
62 | - * @return string |
|
63 | - * @since 8.2.0 |
|
64 | - */ |
|
65 | - public function getType(); |
|
59 | + /** |
|
60 | + * Returns the type of this composite expression (AND/OR). |
|
61 | + * |
|
62 | + * @return string |
|
63 | + * @since 8.2.0 |
|
64 | + */ |
|
65 | + public function getType(); |
|
66 | 66 | } |
@@ -26,9 +26,9 @@ |
||
26 | 26 | * @since 8.2.0 |
27 | 27 | */ |
28 | 28 | interface IParameter { |
29 | - /** |
|
30 | - * @return string |
|
31 | - * @since 8.2.0 |
|
32 | - */ |
|
33 | - public function __toString(); |
|
29 | + /** |
|
30 | + * @return string |
|
31 | + * @since 8.2.0 |
|
32 | + */ |
|
33 | + public function __toString(); |
|
34 | 34 | } |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | /** |
36 | 36 | * @since 9.0.0 |
37 | 37 | */ |
38 | - const EQ = ExpressionBuilder::EQ; |
|
38 | + const EQ = ExpressionBuilder::EQ; |
|
39 | 39 | /** |
40 | 40 | * @since 9.0.0 |
41 | 41 | */ |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | /** |
44 | 44 | * @since 9.0.0 |
45 | 45 | */ |
46 | - const LT = ExpressionBuilder::LT; |
|
46 | + const LT = ExpressionBuilder::LT; |
|
47 | 47 | /** |
48 | 48 | * @since 9.0.0 |
49 | 49 | */ |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | /** |
52 | 52 | * @since 9.0.0 |
53 | 53 | */ |
54 | - const GT = ExpressionBuilder::GT; |
|
54 | + const GT = ExpressionBuilder::GT; |
|
55 | 55 | /** |
56 | 56 | * @since 9.0.0 |
57 | 57 | */ |
@@ -32,336 +32,336 @@ |
||
32 | 32 | * @since 8.2.0 |
33 | 33 | */ |
34 | 34 | interface IExpressionBuilder { |
35 | - /** |
|
36 | - * @since 9.0.0 |
|
37 | - */ |
|
38 | - const EQ = ExpressionBuilder::EQ; |
|
39 | - /** |
|
40 | - * @since 9.0.0 |
|
41 | - */ |
|
42 | - const NEQ = ExpressionBuilder::NEQ; |
|
43 | - /** |
|
44 | - * @since 9.0.0 |
|
45 | - */ |
|
46 | - const LT = ExpressionBuilder::LT; |
|
47 | - /** |
|
48 | - * @since 9.0.0 |
|
49 | - */ |
|
50 | - const LTE = ExpressionBuilder::LTE; |
|
51 | - /** |
|
52 | - * @since 9.0.0 |
|
53 | - */ |
|
54 | - const GT = ExpressionBuilder::GT; |
|
55 | - /** |
|
56 | - * @since 9.0.0 |
|
57 | - */ |
|
58 | - const GTE = ExpressionBuilder::GTE; |
|
35 | + /** |
|
36 | + * @since 9.0.0 |
|
37 | + */ |
|
38 | + const EQ = ExpressionBuilder::EQ; |
|
39 | + /** |
|
40 | + * @since 9.0.0 |
|
41 | + */ |
|
42 | + const NEQ = ExpressionBuilder::NEQ; |
|
43 | + /** |
|
44 | + * @since 9.0.0 |
|
45 | + */ |
|
46 | + const LT = ExpressionBuilder::LT; |
|
47 | + /** |
|
48 | + * @since 9.0.0 |
|
49 | + */ |
|
50 | + const LTE = ExpressionBuilder::LTE; |
|
51 | + /** |
|
52 | + * @since 9.0.0 |
|
53 | + */ |
|
54 | + const GT = ExpressionBuilder::GT; |
|
55 | + /** |
|
56 | + * @since 9.0.0 |
|
57 | + */ |
|
58 | + const GTE = ExpressionBuilder::GTE; |
|
59 | 59 | |
60 | - /** |
|
61 | - * Creates a conjunction of the given boolean expressions. |
|
62 | - * |
|
63 | - * Example: |
|
64 | - * |
|
65 | - * [php] |
|
66 | - * // (u.type = ?) AND (u.role = ?) |
|
67 | - * $expr->andX('u.type = ?', 'u.role = ?')); |
|
68 | - * |
|
69 | - * @param mixed ...$x Optional clause. Defaults = null, but requires |
|
70 | - * at least one defined when converting to string. |
|
71 | - * |
|
72 | - * @return \OCP\DB\QueryBuilder\ICompositeExpression |
|
73 | - * @since 8.2.0 |
|
74 | - */ |
|
75 | - public function andX(...$x); |
|
60 | + /** |
|
61 | + * Creates a conjunction of the given boolean expressions. |
|
62 | + * |
|
63 | + * Example: |
|
64 | + * |
|
65 | + * [php] |
|
66 | + * // (u.type = ?) AND (u.role = ?) |
|
67 | + * $expr->andX('u.type = ?', 'u.role = ?')); |
|
68 | + * |
|
69 | + * @param mixed ...$x Optional clause. Defaults = null, but requires |
|
70 | + * at least one defined when converting to string. |
|
71 | + * |
|
72 | + * @return \OCP\DB\QueryBuilder\ICompositeExpression |
|
73 | + * @since 8.2.0 |
|
74 | + */ |
|
75 | + public function andX(...$x); |
|
76 | 76 | |
77 | - /** |
|
78 | - * Creates a disjunction of the given boolean expressions. |
|
79 | - * |
|
80 | - * Example: |
|
81 | - * |
|
82 | - * [php] |
|
83 | - * // (u.type = ?) OR (u.role = ?) |
|
84 | - * $qb->where($qb->expr()->orX('u.type = ?', 'u.role = ?')); |
|
85 | - * |
|
86 | - * @param mixed ...$x Optional clause. Defaults = null, but requires |
|
87 | - * at least one defined when converting to string. |
|
88 | - * |
|
89 | - * @return \OCP\DB\QueryBuilder\ICompositeExpression |
|
90 | - * @since 8.2.0 |
|
91 | - */ |
|
92 | - public function orX(...$x); |
|
77 | + /** |
|
78 | + * Creates a disjunction of the given boolean expressions. |
|
79 | + * |
|
80 | + * Example: |
|
81 | + * |
|
82 | + * [php] |
|
83 | + * // (u.type = ?) OR (u.role = ?) |
|
84 | + * $qb->where($qb->expr()->orX('u.type = ?', 'u.role = ?')); |
|
85 | + * |
|
86 | + * @param mixed ...$x Optional clause. Defaults = null, but requires |
|
87 | + * at least one defined when converting to string. |
|
88 | + * |
|
89 | + * @return \OCP\DB\QueryBuilder\ICompositeExpression |
|
90 | + * @since 8.2.0 |
|
91 | + */ |
|
92 | + public function orX(...$x); |
|
93 | 93 | |
94 | - /** |
|
95 | - * Creates a comparison expression. |
|
96 | - * |
|
97 | - * @param mixed $x The left expression. |
|
98 | - * @param string $operator One of the IExpressionBuilder::* constants. |
|
99 | - * @param mixed $y The right expression. |
|
100 | - * @param mixed|null $type one of the IQueryBuilder::PARAM_* constants |
|
101 | - * required when comparing text fields for oci compatibility |
|
102 | - * |
|
103 | - * @return string |
|
104 | - * @since 8.2.0 - Parameter $type was added in 9.0.0 |
|
105 | - */ |
|
106 | - public function comparison($x, $operator, $y, $type = null); |
|
94 | + /** |
|
95 | + * Creates a comparison expression. |
|
96 | + * |
|
97 | + * @param mixed $x The left expression. |
|
98 | + * @param string $operator One of the IExpressionBuilder::* constants. |
|
99 | + * @param mixed $y The right expression. |
|
100 | + * @param mixed|null $type one of the IQueryBuilder::PARAM_* constants |
|
101 | + * required when comparing text fields for oci compatibility |
|
102 | + * |
|
103 | + * @return string |
|
104 | + * @since 8.2.0 - Parameter $type was added in 9.0.0 |
|
105 | + */ |
|
106 | + public function comparison($x, $operator, $y, $type = null); |
|
107 | 107 | |
108 | - /** |
|
109 | - * Creates an equality comparison expression with the given arguments. |
|
110 | - * |
|
111 | - * First argument is considered the left expression and the second is the right expression. |
|
112 | - * When converted to string, it will generated a <left expr> = <right expr>. Example: |
|
113 | - * |
|
114 | - * [php] |
|
115 | - * // u.id = ? |
|
116 | - * $expr->eq('u.id', '?'); |
|
117 | - * |
|
118 | - * @param mixed $x The left expression. |
|
119 | - * @param mixed $y The right expression. |
|
120 | - * @param mixed|null $type one of the IQueryBuilder::PARAM_* constants |
|
121 | - * required when comparing text fields for oci compatibility |
|
122 | - * |
|
123 | - * @return string |
|
124 | - * @since 8.2.0 - Parameter $type was added in 9.0.0 |
|
125 | - */ |
|
126 | - public function eq($x, $y, $type = null); |
|
108 | + /** |
|
109 | + * Creates an equality comparison expression with the given arguments. |
|
110 | + * |
|
111 | + * First argument is considered the left expression and the second is the right expression. |
|
112 | + * When converted to string, it will generated a <left expr> = <right expr>. Example: |
|
113 | + * |
|
114 | + * [php] |
|
115 | + * // u.id = ? |
|
116 | + * $expr->eq('u.id', '?'); |
|
117 | + * |
|
118 | + * @param mixed $x The left expression. |
|
119 | + * @param mixed $y The right expression. |
|
120 | + * @param mixed|null $type one of the IQueryBuilder::PARAM_* constants |
|
121 | + * required when comparing text fields for oci compatibility |
|
122 | + * |
|
123 | + * @return string |
|
124 | + * @since 8.2.0 - Parameter $type was added in 9.0.0 |
|
125 | + */ |
|
126 | + public function eq($x, $y, $type = null); |
|
127 | 127 | |
128 | - /** |
|
129 | - * Creates a non equality comparison expression with the given arguments. |
|
130 | - * First argument is considered the left expression and the second is the right expression. |
|
131 | - * When converted to string, it will generated a <left expr> <> <right expr>. Example: |
|
132 | - * |
|
133 | - * [php] |
|
134 | - * // u.id <> 1 |
|
135 | - * $q->where($q->expr()->neq('u.id', '1')); |
|
136 | - * |
|
137 | - * @param mixed $x The left expression. |
|
138 | - * @param mixed $y The right expression. |
|
139 | - * @param mixed|null $type one of the IQueryBuilder::PARAM_* constants |
|
140 | - * required when comparing text fields for oci compatibility |
|
141 | - * |
|
142 | - * @return string |
|
143 | - * @since 8.2.0 - Parameter $type was added in 9.0.0 |
|
144 | - */ |
|
145 | - public function neq($x, $y, $type = null); |
|
128 | + /** |
|
129 | + * Creates a non equality comparison expression with the given arguments. |
|
130 | + * First argument is considered the left expression and the second is the right expression. |
|
131 | + * When converted to string, it will generated a <left expr> <> <right expr>. Example: |
|
132 | + * |
|
133 | + * [php] |
|
134 | + * // u.id <> 1 |
|
135 | + * $q->where($q->expr()->neq('u.id', '1')); |
|
136 | + * |
|
137 | + * @param mixed $x The left expression. |
|
138 | + * @param mixed $y The right expression. |
|
139 | + * @param mixed|null $type one of the IQueryBuilder::PARAM_* constants |
|
140 | + * required when comparing text fields for oci compatibility |
|
141 | + * |
|
142 | + * @return string |
|
143 | + * @since 8.2.0 - Parameter $type was added in 9.0.0 |
|
144 | + */ |
|
145 | + public function neq($x, $y, $type = null); |
|
146 | 146 | |
147 | - /** |
|
148 | - * Creates a lower-than comparison expression with the given arguments. |
|
149 | - * First argument is considered the left expression and the second is the right expression. |
|
150 | - * When converted to string, it will generated a <left expr> < <right expr>. Example: |
|
151 | - * |
|
152 | - * [php] |
|
153 | - * // u.id < ? |
|
154 | - * $q->where($q->expr()->lt('u.id', '?')); |
|
155 | - * |
|
156 | - * @param mixed $x The left expression. |
|
157 | - * @param mixed $y The right expression. |
|
158 | - * @param mixed|null $type one of the IQueryBuilder::PARAM_* constants |
|
159 | - * required when comparing text fields for oci compatibility |
|
160 | - * |
|
161 | - * @return string |
|
162 | - * @since 8.2.0 - Parameter $type was added in 9.0.0 |
|
163 | - */ |
|
164 | - public function lt($x, $y, $type = null); |
|
147 | + /** |
|
148 | + * Creates a lower-than comparison expression with the given arguments. |
|
149 | + * First argument is considered the left expression and the second is the right expression. |
|
150 | + * When converted to string, it will generated a <left expr> < <right expr>. Example: |
|
151 | + * |
|
152 | + * [php] |
|
153 | + * // u.id < ? |
|
154 | + * $q->where($q->expr()->lt('u.id', '?')); |
|
155 | + * |
|
156 | + * @param mixed $x The left expression. |
|
157 | + * @param mixed $y The right expression. |
|
158 | + * @param mixed|null $type one of the IQueryBuilder::PARAM_* constants |
|
159 | + * required when comparing text fields for oci compatibility |
|
160 | + * |
|
161 | + * @return string |
|
162 | + * @since 8.2.0 - Parameter $type was added in 9.0.0 |
|
163 | + */ |
|
164 | + public function lt($x, $y, $type = null); |
|
165 | 165 | |
166 | - /** |
|
167 | - * Creates a lower-than-equal comparison expression with the given arguments. |
|
168 | - * First argument is considered the left expression and the second is the right expression. |
|
169 | - * When converted to string, it will generated a <left expr> <= <right expr>. Example: |
|
170 | - * |
|
171 | - * [php] |
|
172 | - * // u.id <= ? |
|
173 | - * $q->where($q->expr()->lte('u.id', '?')); |
|
174 | - * |
|
175 | - * @param mixed $x The left expression. |
|
176 | - * @param mixed $y The right expression. |
|
177 | - * @param mixed|null $type one of the IQueryBuilder::PARAM_* constants |
|
178 | - * required when comparing text fields for oci compatibility |
|
179 | - * |
|
180 | - * @return string |
|
181 | - * @since 8.2.0 - Parameter $type was added in 9.0.0 |
|
182 | - */ |
|
183 | - public function lte($x, $y, $type = null); |
|
166 | + /** |
|
167 | + * Creates a lower-than-equal comparison expression with the given arguments. |
|
168 | + * First argument is considered the left expression and the second is the right expression. |
|
169 | + * When converted to string, it will generated a <left expr> <= <right expr>. Example: |
|
170 | + * |
|
171 | + * [php] |
|
172 | + * // u.id <= ? |
|
173 | + * $q->where($q->expr()->lte('u.id', '?')); |
|
174 | + * |
|
175 | + * @param mixed $x The left expression. |
|
176 | + * @param mixed $y The right expression. |
|
177 | + * @param mixed|null $type one of the IQueryBuilder::PARAM_* constants |
|
178 | + * required when comparing text fields for oci compatibility |
|
179 | + * |
|
180 | + * @return string |
|
181 | + * @since 8.2.0 - Parameter $type was added in 9.0.0 |
|
182 | + */ |
|
183 | + public function lte($x, $y, $type = null); |
|
184 | 184 | |
185 | - /** |
|
186 | - * Creates a greater-than comparison expression with the given arguments. |
|
187 | - * First argument is considered the left expression and the second is the right expression. |
|
188 | - * When converted to string, it will generated a <left expr> > <right expr>. Example: |
|
189 | - * |
|
190 | - * [php] |
|
191 | - * // u.id > ? |
|
192 | - * $q->where($q->expr()->gt('u.id', '?')); |
|
193 | - * |
|
194 | - * @param mixed $x The left expression. |
|
195 | - * @param mixed $y The right expression. |
|
196 | - * @param mixed|null $type one of the IQueryBuilder::PARAM_* constants |
|
197 | - * required when comparing text fields for oci compatibility |
|
198 | - * |
|
199 | - * @return string |
|
200 | - * @since 8.2.0 - Parameter $type was added in 9.0.0 |
|
201 | - */ |
|
202 | - public function gt($x, $y, $type = null); |
|
185 | + /** |
|
186 | + * Creates a greater-than comparison expression with the given arguments. |
|
187 | + * First argument is considered the left expression and the second is the right expression. |
|
188 | + * When converted to string, it will generated a <left expr> > <right expr>. Example: |
|
189 | + * |
|
190 | + * [php] |
|
191 | + * // u.id > ? |
|
192 | + * $q->where($q->expr()->gt('u.id', '?')); |
|
193 | + * |
|
194 | + * @param mixed $x The left expression. |
|
195 | + * @param mixed $y The right expression. |
|
196 | + * @param mixed|null $type one of the IQueryBuilder::PARAM_* constants |
|
197 | + * required when comparing text fields for oci compatibility |
|
198 | + * |
|
199 | + * @return string |
|
200 | + * @since 8.2.0 - Parameter $type was added in 9.0.0 |
|
201 | + */ |
|
202 | + public function gt($x, $y, $type = null); |
|
203 | 203 | |
204 | - /** |
|
205 | - * Creates a greater-than-equal comparison expression with the given arguments. |
|
206 | - * First argument is considered the left expression and the second is the right expression. |
|
207 | - * When converted to string, it will generated a <left expr> >= <right expr>. Example: |
|
208 | - * |
|
209 | - * [php] |
|
210 | - * // u.id >= ? |
|
211 | - * $q->where($q->expr()->gte('u.id', '?')); |
|
212 | - * |
|
213 | - * @param mixed $x The left expression. |
|
214 | - * @param mixed $y The right expression. |
|
215 | - * @param mixed|null $type one of the IQueryBuilder::PARAM_* constants |
|
216 | - * required when comparing text fields for oci compatibility |
|
217 | - * |
|
218 | - * @return string |
|
219 | - * @since 8.2.0 - Parameter $type was added in 9.0.0 |
|
220 | - */ |
|
221 | - public function gte($x, $y, $type = null); |
|
204 | + /** |
|
205 | + * Creates a greater-than-equal comparison expression with the given arguments. |
|
206 | + * First argument is considered the left expression and the second is the right expression. |
|
207 | + * When converted to string, it will generated a <left expr> >= <right expr>. Example: |
|
208 | + * |
|
209 | + * [php] |
|
210 | + * // u.id >= ? |
|
211 | + * $q->where($q->expr()->gte('u.id', '?')); |
|
212 | + * |
|
213 | + * @param mixed $x The left expression. |
|
214 | + * @param mixed $y The right expression. |
|
215 | + * @param mixed|null $type one of the IQueryBuilder::PARAM_* constants |
|
216 | + * required when comparing text fields for oci compatibility |
|
217 | + * |
|
218 | + * @return string |
|
219 | + * @since 8.2.0 - Parameter $type was added in 9.0.0 |
|
220 | + */ |
|
221 | + public function gte($x, $y, $type = null); |
|
222 | 222 | |
223 | - /** |
|
224 | - * Creates an IS NULL expression with the given arguments. |
|
225 | - * |
|
226 | - * @param string $x The field in string format to be restricted by IS NULL. |
|
227 | - * |
|
228 | - * @return string |
|
229 | - * @since 8.2.0 |
|
230 | - */ |
|
231 | - public function isNull($x); |
|
223 | + /** |
|
224 | + * Creates an IS NULL expression with the given arguments. |
|
225 | + * |
|
226 | + * @param string $x The field in string format to be restricted by IS NULL. |
|
227 | + * |
|
228 | + * @return string |
|
229 | + * @since 8.2.0 |
|
230 | + */ |
|
231 | + public function isNull($x); |
|
232 | 232 | |
233 | - /** |
|
234 | - * Creates an IS NOT NULL expression with the given arguments. |
|
235 | - * |
|
236 | - * @param string $x The field in string format to be restricted by IS NOT NULL. |
|
237 | - * |
|
238 | - * @return string |
|
239 | - * @since 8.2.0 |
|
240 | - */ |
|
241 | - public function isNotNull($x); |
|
233 | + /** |
|
234 | + * Creates an IS NOT NULL expression with the given arguments. |
|
235 | + * |
|
236 | + * @param string $x The field in string format to be restricted by IS NOT NULL. |
|
237 | + * |
|
238 | + * @return string |
|
239 | + * @since 8.2.0 |
|
240 | + */ |
|
241 | + public function isNotNull($x); |
|
242 | 242 | |
243 | - /** |
|
244 | - * Creates a LIKE() comparison expression with the given arguments. |
|
245 | - * |
|
246 | - * @param string $x Field in string format to be inspected by LIKE() comparison. |
|
247 | - * @param mixed $y Argument to be used in LIKE() comparison. |
|
248 | - * @param mixed|null $type one of the IQueryBuilder::PARAM_* constants |
|
249 | - * required when comparing text fields for oci compatibility |
|
250 | - * |
|
251 | - * @return string |
|
252 | - * @since 8.2.0 - Parameter $type was added in 9.0.0 |
|
253 | - */ |
|
254 | - public function like($x, $y, $type = null); |
|
243 | + /** |
|
244 | + * Creates a LIKE() comparison expression with the given arguments. |
|
245 | + * |
|
246 | + * @param string $x Field in string format to be inspected by LIKE() comparison. |
|
247 | + * @param mixed $y Argument to be used in LIKE() comparison. |
|
248 | + * @param mixed|null $type one of the IQueryBuilder::PARAM_* constants |
|
249 | + * required when comparing text fields for oci compatibility |
|
250 | + * |
|
251 | + * @return string |
|
252 | + * @since 8.2.0 - Parameter $type was added in 9.0.0 |
|
253 | + */ |
|
254 | + public function like($x, $y, $type = null); |
|
255 | 255 | |
256 | - /** |
|
257 | - * Creates a NOT LIKE() comparison expression with the given arguments. |
|
258 | - * |
|
259 | - * @param string $x Field in string format to be inspected by NOT LIKE() comparison. |
|
260 | - * @param mixed $y Argument to be used in NOT LIKE() comparison. |
|
261 | - * @param mixed|null $type one of the IQueryBuilder::PARAM_* constants |
|
262 | - * required when comparing text fields for oci compatibility |
|
263 | - * |
|
264 | - * @return string |
|
265 | - * @since 8.2.0 - Parameter $type was added in 9.0.0 |
|
266 | - */ |
|
267 | - public function notLike($x, $y, $type = null); |
|
256 | + /** |
|
257 | + * Creates a NOT LIKE() comparison expression with the given arguments. |
|
258 | + * |
|
259 | + * @param string $x Field in string format to be inspected by NOT LIKE() comparison. |
|
260 | + * @param mixed $y Argument to be used in NOT LIKE() comparison. |
|
261 | + * @param mixed|null $type one of the IQueryBuilder::PARAM_* constants |
|
262 | + * required when comparing text fields for oci compatibility |
|
263 | + * |
|
264 | + * @return string |
|
265 | + * @since 8.2.0 - Parameter $type was added in 9.0.0 |
|
266 | + */ |
|
267 | + public function notLike($x, $y, $type = null); |
|
268 | 268 | |
269 | - /** |
|
270 | - * Creates a ILIKE() comparison expression with the given arguments. |
|
271 | - * |
|
272 | - * @param string $x Field in string format to be inspected by ILIKE() comparison. |
|
273 | - * @param mixed $y Argument to be used in ILIKE() comparison. |
|
274 | - * @param mixed|null $type one of the IQueryBuilder::PARAM_* constants |
|
275 | - * required when comparing text fields for oci compatibility |
|
276 | - * |
|
277 | - * @return string |
|
278 | - * @since 9.0.0 |
|
279 | - */ |
|
280 | - public function iLike($x, $y, $type = null); |
|
269 | + /** |
|
270 | + * Creates a ILIKE() comparison expression with the given arguments. |
|
271 | + * |
|
272 | + * @param string $x Field in string format to be inspected by ILIKE() comparison. |
|
273 | + * @param mixed $y Argument to be used in ILIKE() comparison. |
|
274 | + * @param mixed|null $type one of the IQueryBuilder::PARAM_* constants |
|
275 | + * required when comparing text fields for oci compatibility |
|
276 | + * |
|
277 | + * @return string |
|
278 | + * @since 9.0.0 |
|
279 | + */ |
|
280 | + public function iLike($x, $y, $type = null); |
|
281 | 281 | |
282 | - /** |
|
283 | - * Creates a IN () comparison expression with the given arguments. |
|
284 | - * |
|
285 | - * @param string $x The field in string format to be inspected by IN() comparison. |
|
286 | - * @param string|array $y The placeholder or the array of values to be used by IN() comparison. |
|
287 | - * @param mixed|null $type one of the IQueryBuilder::PARAM_* constants |
|
288 | - * required when comparing text fields for oci compatibility |
|
289 | - * |
|
290 | - * @return string |
|
291 | - * @since 8.2.0 - Parameter $type was added in 9.0.0 |
|
292 | - */ |
|
293 | - public function in($x, $y, $type = null); |
|
282 | + /** |
|
283 | + * Creates a IN () comparison expression with the given arguments. |
|
284 | + * |
|
285 | + * @param string $x The field in string format to be inspected by IN() comparison. |
|
286 | + * @param string|array $y The placeholder or the array of values to be used by IN() comparison. |
|
287 | + * @param mixed|null $type one of the IQueryBuilder::PARAM_* constants |
|
288 | + * required when comparing text fields for oci compatibility |
|
289 | + * |
|
290 | + * @return string |
|
291 | + * @since 8.2.0 - Parameter $type was added in 9.0.0 |
|
292 | + */ |
|
293 | + public function in($x, $y, $type = null); |
|
294 | 294 | |
295 | - /** |
|
296 | - * Creates a NOT IN () comparison expression with the given arguments. |
|
297 | - * |
|
298 | - * @param string $x The field in string format to be inspected by NOT IN() comparison. |
|
299 | - * @param string|array $y The placeholder or the array of values to be used by NOT IN() comparison. |
|
300 | - * @param mixed|null $type one of the IQueryBuilder::PARAM_* constants |
|
301 | - * required when comparing text fields for oci compatibility |
|
302 | - * |
|
303 | - * @return string |
|
304 | - * @since 8.2.0 - Parameter $type was added in 9.0.0 |
|
305 | - */ |
|
306 | - public function notIn($x, $y, $type = null); |
|
295 | + /** |
|
296 | + * Creates a NOT IN () comparison expression with the given arguments. |
|
297 | + * |
|
298 | + * @param string $x The field in string format to be inspected by NOT IN() comparison. |
|
299 | + * @param string|array $y The placeholder or the array of values to be used by NOT IN() comparison. |
|
300 | + * @param mixed|null $type one of the IQueryBuilder::PARAM_* constants |
|
301 | + * required when comparing text fields for oci compatibility |
|
302 | + * |
|
303 | + * @return string |
|
304 | + * @since 8.2.0 - Parameter $type was added in 9.0.0 |
|
305 | + */ |
|
306 | + public function notIn($x, $y, $type = null); |
|
307 | 307 | |
308 | - /** |
|
309 | - * Creates a $x = '' statement, because Oracle needs a different check |
|
310 | - * |
|
311 | - * @param string $x The field in string format to be inspected by the comparison. |
|
312 | - * @return string |
|
313 | - * @since 13.0.0 |
|
314 | - */ |
|
315 | - public function emptyString($x); |
|
308 | + /** |
|
309 | + * Creates a $x = '' statement, because Oracle needs a different check |
|
310 | + * |
|
311 | + * @param string $x The field in string format to be inspected by the comparison. |
|
312 | + * @return string |
|
313 | + * @since 13.0.0 |
|
314 | + */ |
|
315 | + public function emptyString($x); |
|
316 | 316 | |
317 | - /** |
|
318 | - * Creates a `$x <> ''` statement, because Oracle needs a different check |
|
319 | - * |
|
320 | - * @param string $x The field in string format to be inspected by the comparison. |
|
321 | - * @return string |
|
322 | - * @since 13.0.0 |
|
323 | - */ |
|
324 | - public function nonEmptyString($x); |
|
317 | + /** |
|
318 | + * Creates a `$x <> ''` statement, because Oracle needs a different check |
|
319 | + * |
|
320 | + * @param string $x The field in string format to be inspected by the comparison. |
|
321 | + * @return string |
|
322 | + * @since 13.0.0 |
|
323 | + */ |
|
324 | + public function nonEmptyString($x); |
|
325 | 325 | |
326 | 326 | |
327 | - /** |
|
328 | - * Creates a bitwise AND comparison |
|
329 | - * |
|
330 | - * @param string|ILiteral $x The field or value to check |
|
331 | - * @param int $y Bitmap that must be set |
|
332 | - * @return IQueryFunction |
|
333 | - * @since 12.0.0 |
|
334 | - */ |
|
335 | - public function bitwiseAnd($x, $y); |
|
327 | + /** |
|
328 | + * Creates a bitwise AND comparison |
|
329 | + * |
|
330 | + * @param string|ILiteral $x The field or value to check |
|
331 | + * @param int $y Bitmap that must be set |
|
332 | + * @return IQueryFunction |
|
333 | + * @since 12.0.0 |
|
334 | + */ |
|
335 | + public function bitwiseAnd($x, $y); |
|
336 | 336 | |
337 | - /** |
|
338 | - * Creates a bitwise OR comparison |
|
339 | - * |
|
340 | - * @param string|ILiteral $x The field or value to check |
|
341 | - * @param int $y Bitmap that must be set |
|
342 | - * @return IQueryFunction |
|
343 | - * @since 12.0.0 |
|
344 | - */ |
|
345 | - public function bitwiseOr($x, $y); |
|
337 | + /** |
|
338 | + * Creates a bitwise OR comparison |
|
339 | + * |
|
340 | + * @param string|ILiteral $x The field or value to check |
|
341 | + * @param int $y Bitmap that must be set |
|
342 | + * @return IQueryFunction |
|
343 | + * @since 12.0.0 |
|
344 | + */ |
|
345 | + public function bitwiseOr($x, $y); |
|
346 | 346 | |
347 | - /** |
|
348 | - * Quotes a given input parameter. |
|
349 | - * |
|
350 | - * @param mixed $input The parameter to be quoted. |
|
351 | - * @param mixed|null $type One of the IQueryBuilder::PARAM_* constants |
|
352 | - * |
|
353 | - * @return string |
|
354 | - * @since 8.2.0 |
|
355 | - */ |
|
356 | - public function literal($input, $type = null); |
|
347 | + /** |
|
348 | + * Quotes a given input parameter. |
|
349 | + * |
|
350 | + * @param mixed $input The parameter to be quoted. |
|
351 | + * @param mixed|null $type One of the IQueryBuilder::PARAM_* constants |
|
352 | + * |
|
353 | + * @return string |
|
354 | + * @since 8.2.0 |
|
355 | + */ |
|
356 | + public function literal($input, $type = null); |
|
357 | 357 | |
358 | - /** |
|
359 | - * Returns a IQueryFunction that casts the column to the given type |
|
360 | - * |
|
361 | - * @param string $column |
|
362 | - * @param mixed $type One of IQueryBuilder::PARAM_* |
|
363 | - * @return string |
|
364 | - * @since 9.0.0 |
|
365 | - */ |
|
366 | - public function castColumn($column, $type); |
|
358 | + /** |
|
359 | + * Returns a IQueryFunction that casts the column to the given type |
|
360 | + * |
|
361 | + * @param string $column |
|
362 | + * @param mixed $type One of IQueryBuilder::PARAM_* |
|
363 | + * @return string |
|
364 | + * @since 9.0.0 |
|
365 | + */ |
|
366 | + public function castColumn($column, $type); |
|
367 | 367 | } |