@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | |
101 | 101 | $needle = $prevEntityAlias . "_" . $currentEntityAlias; |
102 | 102 | |
103 | - return ! in_array($needle, $this->joins); |
|
103 | + return !in_array($needle, $this->joins); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | private function storeJoin($prevEntityAlias, $currentEntityAlias) |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | $fieldName = $this->parser->camelize($filtering->getFieldName()); |
211 | 211 | |
212 | 212 | $operator = Operators::getDefaultOperator(); |
213 | - if($filtering->hasOperator()){ |
|
213 | + if ($filtering->hasOperator()) { |
|
214 | 214 | $operator = Operators::get($filtering->getOperator()); |
215 | 215 | } |
216 | 216 | |
@@ -227,18 +227,18 @@ discard block |
||
227 | 227 | |
228 | 228 | if ($filtering->hasOperator()) { |
229 | 229 | if ('list' == $filtering->getOperator()) { |
230 | - $whereCondition = $this->entityAlias.'.'.$fieldName.' '.$operator['meta'].' (:field_'.$fieldName . $salt . ')'; |
|
230 | + $whereCondition = $this->entityAlias . '.' . $fieldName . ' ' . $operator['meta'] . ' (:field_' . $fieldName . $salt . ')'; |
|
231 | 231 | } else if ('field_eq' == $filtering->getOperator()) { |
232 | 232 | $whereCondition = |
233 | - $this->entityAlias . '.' . $fieldName . ' '. |
|
233 | + $this->entityAlias . '.' . $fieldName . ' ' . |
|
234 | 234 | $operator['meta'] . '' . |
235 | 235 | $this->entityAlias . '.' . $value |
236 | 236 | ; |
237 | 237 | } else { |
238 | - $whereCondition = $this->entityAlias.'.'.$fieldName.' '.$operator['meta'].' :field_'.$fieldName . $salt; |
|
238 | + $whereCondition = $this->entityAlias . '.' . $fieldName . ' ' . $operator['meta'] . ' :field_' . $fieldName . $salt; |
|
239 | 239 | } |
240 | 240 | } else { |
241 | - $whereCondition = $this->entityAlias.'.'.$fieldName.' = :field_'.$fieldName . $salt; |
|
241 | + $whereCondition = $this->entityAlias . '.' . $fieldName . ' = :field_' . $fieldName . $salt; |
|
242 | 242 | } |
243 | 243 | |
244 | 244 | $this->qBuilder->andWhere($whereCondition); |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | } else { |
260 | 260 | $isNotARelation = 0 !== strpos($fieldName, 'Embedded.'); |
261 | 261 | if ($isNotARelation) { |
262 | - $whereCondition = $this->entityAlias.'.'.$fieldName.' '.$operator['meta'].' ' . $this->entityAlias . '.' . $value; |
|
262 | + $whereCondition = $this->entityAlias . '.' . $fieldName . ' ' . $operator['meta'] . ' ' . $this->entityAlias . '.' . $value; |
|
263 | 263 | $this->qBuilder->andWhere($whereCondition); |
264 | 264 | } |
265 | 265 | } |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | $relationEntityAlias = $this->getRelationEntityAlias(); |
273 | 273 | |
274 | 274 | $embeddedFields = explode('.', $fieldName); |
275 | - $fieldName = $this->parser->camelize($embeddedFields[count($embeddedFields)-1]); |
|
275 | + $fieldName = $this->parser->camelize($embeddedFields[count($embeddedFields) - 1]); |
|
276 | 276 | |
277 | 277 | $salt = ''; |
278 | 278 | foreach ($this->qBuilder->getParameters() as $parameter) { |
@@ -282,9 +282,9 @@ discard block |
||
282 | 282 | } |
283 | 283 | |
284 | 284 | if ($filtering->hasOperator() && 'list' == $filtering->getOperator()) { |
285 | - $whereCondition = $relationEntityAlias.'.'.$fieldName.' '.$operator['meta'].' (:field_'.$fieldName . $salt . ')'; |
|
285 | + $whereCondition = $relationEntityAlias . '.' . $fieldName . ' ' . $operator['meta'] . ' (:field_' . $fieldName . $salt . ')'; |
|
286 | 286 | } else { |
287 | - $whereCondition = $relationEntityAlias.'.'.$fieldName.' '.$operator['meta'].' :field_'.$fieldName . $salt; |
|
287 | + $whereCondition = $relationEntityAlias . '.' . $fieldName . ' ' . $operator['meta'] . ' :field_' . $fieldName . $salt; |
|
288 | 288 | } |
289 | 289 | |
290 | 290 | $this->qBuilder->andWhere($whereCondition); |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | $fieldName = $this->parser->camelize($filtering->getFieldName()); |
313 | 313 | |
314 | 314 | $operator = Operators::getDefaultOperator(); |
315 | - if($filtering->hasOperator()) { |
|
315 | + if ($filtering->hasOperator()) { |
|
316 | 316 | $operator = Operators::get($filtering->getOperator()); |
317 | 317 | } |
318 | 318 | |
@@ -329,10 +329,10 @@ discard block |
||
329 | 329 | |
330 | 330 | if ($filtering->hasOperator()) { |
331 | 331 | if ('list' == $filtering->getOperator()) { |
332 | - $whereCondition = $this->entityAlias.'.'.$fieldName.' '.$operator['meta'].' (:field_'.$fieldName . $salt . ')'; |
|
332 | + $whereCondition = $this->entityAlias . '.' . $fieldName . ' ' . $operator['meta'] . ' (:field_' . $fieldName . $salt . ')'; |
|
333 | 333 | } else if ('field_eq' == $filtering->getOperator()) { |
334 | 334 | $whereCondition = |
335 | - $this->entityAlias . '.' . $fieldName . ' '. |
|
335 | + $this->entityAlias . '.' . $fieldName . ' ' . |
|
336 | 336 | $operator['meta'] . '' . |
337 | 337 | $this->entityAlias . '.' . $value |
338 | 338 | ; |
@@ -341,10 +341,10 @@ discard block |
||
341 | 341 | //'Oops! Eccezzione' |
342 | 342 | //); |
343 | 343 | } else { |
344 | - $whereCondition = $this->entityAlias.'.'.$fieldName.' '.$operator['meta'].' :field_'.$fieldName . $salt; |
|
344 | + $whereCondition = $this->entityAlias . '.' . $fieldName . ' ' . $operator['meta'] . ' :field_' . $fieldName . $salt; |
|
345 | 345 | } |
346 | 346 | } else { |
347 | - $whereCondition = $this->entityAlias.'.'.$fieldName.' = :field_'.$fieldName . $salt; |
|
347 | + $whereCondition = $this->entityAlias . '.' . $fieldName . ' = :field_' . $fieldName . $salt; |
|
348 | 348 | } |
349 | 349 | |
350 | 350 | if ($orCondition['orCondition'] != null) { |
@@ -372,7 +372,7 @@ discard block |
||
372 | 372 | } else { |
373 | 373 | $isNotARelation = 0 !== strpos($fieldName, 'Embedded.'); |
374 | 374 | if ($isNotARelation) { |
375 | - $whereCondition = $this->entityAlias.'.'.$fieldName.' '.$operator['meta'].' ' . $this->entityAlias . '.' . $value; |
|
375 | + $whereCondition = $this->entityAlias . '.' . $fieldName . ' ' . $operator['meta'] . ' ' . $this->entityAlias . '.' . $value; |
|
376 | 376 | if ($orCondition['orCondition'] != null) { |
377 | 377 | $orCondition['orCondition'] .= ' OR ' . $whereCondition; |
378 | 378 | } else { |
@@ -389,7 +389,7 @@ discard block |
||
389 | 389 | $relationEntityAlias = $this->getRelationEntityAlias(); |
390 | 390 | |
391 | 391 | $embeddedFields = explode('.', $fieldName); |
392 | - $fieldName = $this->parser->camelize($embeddedFields[count($embeddedFields)-1]); |
|
392 | + $fieldName = $this->parser->camelize($embeddedFields[count($embeddedFields) - 1]); |
|
393 | 393 | |
394 | 394 | $salt = ''; |
395 | 395 | foreach ($this->qBuilder->getParameters() as $parameter) { |
@@ -399,9 +399,9 @@ discard block |
||
399 | 399 | } |
400 | 400 | |
401 | 401 | if ($filtering->hasOperator() && 'list' == $filtering->getOperator()) { |
402 | - $whereCondition = $relationEntityAlias.'.'.$fieldName.' '.$operator['meta'].' (:field_'.$fieldName . $salt . ')'; |
|
402 | + $whereCondition = $relationEntityAlias . '.' . $fieldName . ' ' . $operator['meta'] . ' (:field_' . $fieldName . $salt . ')'; |
|
403 | 403 | } else { |
404 | - $whereCondition = $relationEntityAlias.'.'.$fieldName.' '.$operator['meta'].' :field_'.$fieldName . $salt; |
|
404 | + $whereCondition = $relationEntityAlias . '.' . $fieldName . ' ' . $operator['meta'] . ' :field_' . $fieldName . $salt; |
|
405 | 405 | } |
406 | 406 | |
407 | 407 | if ($orCondition['orCondition'] != null) { |
@@ -452,7 +452,7 @@ discard block |
||
452 | 452 | |
453 | 453 | if (in_array($fieldName, $this->fields)) { |
454 | 454 | $direction = ($val === self::DIRECTION_AZ) ? self::DIRECTION_AZ : self::DIRECTION_ZA; |
455 | - $this->qBuilder->addOrderBy($this->entityAlias .'.'. $fieldName, $direction); |
|
455 | + $this->qBuilder->addOrderBy($this->entityAlias . '.' . $fieldName, $direction); |
|
456 | 456 | } |
457 | 457 | |
458 | 458 | if (strstr($sort, '_embedded.')) { |
@@ -463,7 +463,7 @@ discard block |
||
463 | 463 | $fieldName = $this->parser->camelize($embeddedFields[2]); |
464 | 464 | $direction = ($val === self::DIRECTION_AZ) ? self::DIRECTION_AZ : self::DIRECTION_ZA; |
465 | 465 | |
466 | - $this->qBuilder->addOrderBy($relationEntityAlias.'.'.$fieldName, $direction); |
|
466 | + $this->qBuilder->addOrderBy($relationEntityAlias . '.' . $fieldName, $direction); |
|
467 | 467 | } |
468 | 468 | |
469 | 469 | } |
@@ -47,8 +47,8 @@ discard block |
||
47 | 47 | |
48 | 48 | $this->fields = array_keys($this->getClassMetadata()->fieldMappings); |
49 | 49 | |
50 | - $entityName = explode('\\', strtolower($this->getEntityName()) ); |
|
51 | - $entityName = $entityName[count($entityName)-1]; |
|
50 | + $entityName = explode('\\', strtolower($this->getEntityName())); |
|
51 | + $entityName = $entityName[count($entityName) - 1]; |
|
52 | 52 | $entityAlias = $entityName[0]; |
53 | 53 | $this->entityAlias = $entityAlias; |
54 | 54 | |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | foreach ($orFilters as $key => $filter) { |
125 | 125 | if (is_array($filter)) { |
126 | 126 | foreach ($filter as $keyInternal => $internal) { |
127 | - $filterOrCorrected[$keyInternal .'|' . $count] = $internal; |
|
127 | + $filterOrCorrected[$keyInternal . '|' . $count] = $internal; |
|
128 | 128 | $count = $count + 1; |
129 | 129 | } |
130 | 130 | } else { |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | foreach ($orFilters as $key => $filter) { |
193 | 193 | if (is_array($filter)) { |
194 | 194 | foreach ($filter as $keyInternal => $internal) { |
195 | - $filterOrCorrected[$keyInternal .'|' . $count] = $internal; |
|
195 | + $filterOrCorrected[$keyInternal . '|' . $count] = $internal; |
|
196 | 196 | $count = $count + 1; |
197 | 197 | } |
198 | 198 | } else { |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | foreach ($orFilters as $key => $filter) { |
249 | 249 | if (is_array($filter)) { |
250 | 250 | foreach ($filter as $keyInternal => $internal) { |
251 | - $filterOrCorrected[$keyInternal .'|' . $count] = $internal; |
|
251 | + $filterOrCorrected[$keyInternal . '|' . $count] = $internal; |
|
252 | 252 | $count = $count + 1; |
253 | 253 | } |
254 | 254 | } else { |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | $pagerAdapter = new DoctrineORMAdapter($queryBuilder); |
318 | 318 | |
319 | 319 | $query = $pagerAdapter->getQuery(); |
320 | - if(isset($this->use_result_cache) and $this->use_result_cache){ |
|
320 | + if (isset($this->use_result_cache) and $this->use_result_cache) { |
|
321 | 321 | $query->useResultCache(true, 600); |
322 | 322 | } |
323 | 323 | |
@@ -356,7 +356,7 @@ discard block |
||
356 | 356 | $params[$itemValue] = $this->queryOptions->get($itemValue); |
357 | 357 | } |
358 | 358 | |
359 | - if(!isset($this->route_name)){ |
|
359 | + if (!isset($this->route_name)) { |
|
360 | 360 | $this->route_name = $this->queryOptions->get('_route'); |
361 | 361 | } |
362 | 362 | |
@@ -367,7 +367,7 @@ discard block |
||
367 | 367 | public function noExistsJoin($prevEntityAlias, $currentEntityAlias) |
368 | 368 | { |
369 | 369 | $needle = $prevEntityAlias . "_" . $currentEntityAlias; |
370 | - return ! in_array($needle, $this->joins); |
|
370 | + return !in_array($needle, $this->joins); |
|
371 | 371 | } |
372 | 372 | |
373 | 373 | /** @deprecate use QueryBuilderFactory instead */ |
@@ -443,8 +443,8 @@ discard block |
||
443 | 443 | |
444 | 444 | public function getEntityAlias(string $entityName) : string |
445 | 445 | { |
446 | - $arrayEntityName = explode('\\', strtolower($entityName) ); |
|
447 | - $entityAlias = $arrayEntityName[count($arrayEntityName)-1]; |
|
446 | + $arrayEntityName = explode('\\', strtolower($entityName)); |
|
447 | + $entityAlias = $arrayEntityName[count($arrayEntityName) - 1]; |
|
448 | 448 | return $entityAlias; |
449 | 449 | } |
450 | 450 | |
@@ -475,16 +475,16 @@ discard block |
||
475 | 475 | |
476 | 476 | $table = $this->getEntityManager()->getClassMetadata($this->getEntityName())->getTableName(); |
477 | 477 | |
478 | - $sql = 'INSERT INTO '.$table; |
|
479 | - $sql .= '('. $list_keys . ') '; |
|
478 | + $sql = 'INSERT INTO ' . $table; |
|
479 | + $sql .= '(' . $list_keys . ') '; |
|
480 | 480 | //$sql .= 'VALUES("'.implode('","', $insertFields).'") '; |
481 | - $sql .= "VALUES(". $list_values.") "; |
|
481 | + $sql .= "VALUES(" . $list_values . ") "; |
|
482 | 482 | $sql .= 'ON DUPLICATE KEY UPDATE '; |
483 | 483 | |
484 | 484 | $c = 0; |
485 | - foreach($updateFields as $column => $value) { |
|
486 | - if($c>0)$sql .= ", "; |
|
487 | - $sql .= '`'.$column . "` = '". $value."'"; |
|
485 | + foreach ($updateFields as $column => $value) { |
|
486 | + if ($c > 0)$sql .= ", "; |
|
487 | + $sql .= '`' . $column . "` = '" . $value . "'"; |
|
488 | 488 | $c++; |
489 | 489 | } |
490 | 490 |
@@ -483,7 +483,9 @@ |
||
483 | 483 | |
484 | 484 | $c = 0; |
485 | 485 | foreach($updateFields as $column => $value) { |
486 | - if($c>0)$sql .= ", "; |
|
486 | + if($c>0) { |
|
487 | + $sql .= ", "; |
|
488 | + } |
|
487 | 489 | $sql .= '`'.$column . "` = '". $value."'"; |
488 | 490 | $c++; |
489 | 491 | } |
@@ -22,7 +22,7 @@ |
||
22 | 22 | $configuration = new Configuration(); |
23 | 23 | $config = $this->processConfiguration($configuration, $configs); |
24 | 24 | |
25 | - $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); |
|
25 | + $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); |
|
26 | 26 | $loader->load('services.yml'); |
27 | 27 | } |
28 | 28 | } |
@@ -37,7 +37,7 @@ |
||
37 | 37 | |
38 | 38 | public function getFieldName() |
39 | 39 | { |
40 | - return $this->properties[FilteringObject::KEY_FIELD_NAME]; |
|
40 | + return $this->properties[FilteringObject::KEY_FIELD_NAME]; |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | public function getOperator() |