@@ -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() |
@@ -39,8 +39,8 @@ discard block |
||
39 | 39 | |
40 | 40 | $this->fields = array_keys($this->getClassMetadata()->fieldMappings); |
41 | 41 | |
42 | - $entityName = explode('\\', strtolower($this->getEntityName()) ); |
|
43 | - $entityName = $entityName[count($entityName)-1]; |
|
42 | + $entityName = explode('\\', strtolower($this->getEntityName())); |
|
43 | + $entityName = $entityName[count($entityName) - 1]; |
|
44 | 44 | $entityAlias = $entityName[0]; |
45 | 45 | $this->entityAlias = $entityAlias; |
46 | 46 | |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | foreach ($orFilters as $key => $filter) { |
116 | 116 | if (is_array($filter)) { |
117 | 117 | foreach ($filter as $keyInternal => $internal) { |
118 | - $filterOrCorrected[$keyInternal .'|' . $count] = $internal; |
|
118 | + $filterOrCorrected[$keyInternal . '|' . $count] = $internal; |
|
119 | 119 | $count = $count + 1; |
120 | 120 | } |
121 | 121 | } else { |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | foreach ($orFilters as $key => $filter) { |
183 | 183 | if (is_array($filter)) { |
184 | 184 | foreach ($filter as $keyInternal => $internal) { |
185 | - $filterOrCorrected[$keyInternal .'|' . $count] = $internal; |
|
185 | + $filterOrCorrected[$keyInternal . '|' . $count] = $internal; |
|
186 | 186 | $count = $count + 1; |
187 | 187 | } |
188 | 188 | } else { |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | foreach ($orFilters as $key => $filter) { |
238 | 238 | if (is_array($filter)) { |
239 | 239 | foreach ($filter as $keyInternal => $internal) { |
240 | - $filterOrCorrected[$keyInternal .'|' . $count] = $internal; |
|
240 | + $filterOrCorrected[$keyInternal . '|' . $count] = $internal; |
|
241 | 241 | $count = $count + 1; |
242 | 242 | } |
243 | 243 | } else { |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | $pagerAdapter = new DoctrineORMAdapter($queryBuilder); |
307 | 307 | |
308 | 308 | $query = $pagerAdapter->getQuery(); |
309 | - if(isset($this->use_result_cache) and $this->use_result_cache){ |
|
309 | + if (isset($this->use_result_cache) and $this->use_result_cache) { |
|
310 | 310 | $query->useResultCache(true, 600); |
311 | 311 | } |
312 | 312 | |
@@ -344,7 +344,7 @@ discard block |
||
344 | 344 | $params[$itemValue] = $this->queryOptions->get($itemValue); |
345 | 345 | } |
346 | 346 | |
347 | - if(!isset($this->route_name)){ |
|
347 | + if (!isset($this->route_name)) { |
|
348 | 348 | $this->route_name = $this->queryOptions->get('_route'); |
349 | 349 | } |
350 | 350 | |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | public function noExistsJoin($prevEntityAlias, $currentEntityAlias) |
356 | 356 | { |
357 | 357 | $needle = $prevEntityAlias . "_" . $currentEntityAlias; |
358 | - return ! in_array($needle, $this->joins); |
|
358 | + return !in_array($needle, $this->joins); |
|
359 | 359 | } |
360 | 360 | |
361 | 361 | /** @deprecate use QueryBuilderFactory instead */ |
@@ -431,8 +431,8 @@ discard block |
||
431 | 431 | |
432 | 432 | public function getEntityAlias(string $entityName) : string |
433 | 433 | { |
434 | - $arrayEntityName = explode('\\', strtolower($entityName) ); |
|
435 | - $entityAlias = $arrayEntityName[count($arrayEntityName)-1]; |
|
434 | + $arrayEntityName = explode('\\', strtolower($entityName)); |
|
435 | + $entityAlias = $arrayEntityName[count($arrayEntityName) - 1]; |
|
436 | 436 | return $entityAlias; |
437 | 437 | } |
438 | 438 | |
@@ -461,18 +461,18 @@ discard block |
||
461 | 461 | |
462 | 462 | $table = $this->getEntityManager()->getClassMetadata($this->getEntityName())->getTableName(); |
463 | 463 | |
464 | - $sql = 'INSERT INTO '.$table; |
|
465 | - $sql .= '('. $list_keys . ') '; |
|
466 | - $sql .= "VALUES(". $list_values.") "; |
|
464 | + $sql = 'INSERT INTO ' . $table; |
|
465 | + $sql .= '(' . $list_keys . ') '; |
|
466 | + $sql .= "VALUES(" . $list_values . ") "; |
|
467 | 467 | $sql .= 'ON DUPLICATE KEY UPDATE '; |
468 | 468 | |
469 | 469 | $c = 0; |
470 | - foreach($updateFields as $column => $value) { |
|
470 | + foreach ($updateFields as $column => $value) { |
|
471 | 471 | if ($c > 0) { |
472 | 472 | $sql .= ", "; |
473 | 473 | } |
474 | 474 | |
475 | - $sql .= '`'.$column . "` = '". $value."'"; |
|
475 | + $sql .= '`' . $column . "` = '" . $value . "'"; |
|
476 | 476 | $c++; |
477 | 477 | } |
478 | 478 |
@@ -22,7 +22,7 @@ |
||
22 | 22 | $configuration = new Configuration(); |
23 | 23 | $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 | } |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | |
133 | 133 | $needle = $prevEntityAlias . "_" . $currentEntityAlias; |
134 | 134 | |
135 | - return ! in_array($needle, $this->joins); |
|
135 | + return !in_array($needle, $this->joins); |
|
136 | 136 | } |
137 | 137 | |
138 | 138 | private function storeJoin($prevEntityAlias, $currentEntityAlias) |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | $fieldName = $this->parser->camelize($filtering->getFieldName()); |
233 | 233 | |
234 | 234 | $operator = Operators::getDefaultOperator(); |
235 | - if($filtering->hasOperator()){ |
|
235 | + if ($filtering->hasOperator()) { |
|
236 | 236 | $operator = Operators::get($filtering->getOperator()); |
237 | 237 | } |
238 | 238 | |
@@ -249,18 +249,18 @@ discard block |
||
249 | 249 | |
250 | 250 | if ($filtering->hasOperator()) { |
251 | 251 | if ('list' == $filtering->getOperator()) { |
252 | - $whereCondition = $this->entityAlias.'.'.$fieldName.' '.$operator['meta'].' (:field_'.$fieldName . $salt . ')'; |
|
252 | + $whereCondition = $this->entityAlias . '.' . $fieldName . ' ' . $operator['meta'] . ' (:field_' . $fieldName . $salt . ')'; |
|
253 | 253 | } else if ('field_eq' == $filtering->getOperator()) { |
254 | 254 | $whereCondition = |
255 | - $this->entityAlias . '.' . $fieldName . ' '. |
|
255 | + $this->entityAlias . '.' . $fieldName . ' ' . |
|
256 | 256 | $operator['meta'] . '' . |
257 | 257 | $this->entityAlias . '.' . $value |
258 | 258 | ; |
259 | 259 | } else { |
260 | - $whereCondition = $this->entityAlias.'.'.$fieldName.' '.$operator['meta'].' :field_'.$fieldName . $salt; |
|
260 | + $whereCondition = $this->entityAlias . '.' . $fieldName . ' ' . $operator['meta'] . ' :field_' . $fieldName . $salt; |
|
261 | 261 | } |
262 | 262 | } else { |
263 | - $whereCondition = $this->entityAlias.'.'.$fieldName.' = :field_'.$fieldName . $salt; |
|
263 | + $whereCondition = $this->entityAlias . '.' . $fieldName . ' = :field_' . $fieldName . $salt; |
|
264 | 264 | } |
265 | 265 | |
266 | 266 | $this->qBuilder->andWhere($whereCondition); |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | } else { |
282 | 282 | $isNotARelation = 0 !== strpos($fieldName, 'Embedded.'); |
283 | 283 | if ($isNotARelation) { |
284 | - $whereCondition = $this->entityAlias.'.'.$fieldName.' '.$operator['meta'].' ' . $this->entityAlias . '.' . $value; |
|
284 | + $whereCondition = $this->entityAlias . '.' . $fieldName . ' ' . $operator['meta'] . ' ' . $this->entityAlias . '.' . $value; |
|
285 | 285 | $this->qBuilder->andWhere($whereCondition); |
286 | 286 | } |
287 | 287 | } |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | $relationEntityAlias = $this->getRelationEntityAlias(); |
295 | 295 | |
296 | 296 | $embeddedFields = explode('.', $fieldName); |
297 | - $fieldName = $this->parser->camelize($embeddedFields[count($embeddedFields)-1]); |
|
297 | + $fieldName = $this->parser->camelize($embeddedFields[count($embeddedFields) - 1]); |
|
298 | 298 | |
299 | 299 | $salt = ''; |
300 | 300 | foreach ($this->qBuilder->getParameters() as $parameter) { |
@@ -304,9 +304,9 @@ discard block |
||
304 | 304 | } |
305 | 305 | |
306 | 306 | if ($filtering->hasOperator() && 'list' == $filtering->getOperator()) { |
307 | - $whereCondition = $relationEntityAlias.'.'.$fieldName.' '.$operator['meta'].' (:field_'.$fieldName . $salt . ')'; |
|
307 | + $whereCondition = $relationEntityAlias . '.' . $fieldName . ' ' . $operator['meta'] . ' (:field_' . $fieldName . $salt . ')'; |
|
308 | 308 | } else { |
309 | - $whereCondition = $relationEntityAlias.'.'.$fieldName.' '.$operator['meta'].' :field_'.$fieldName . $salt; |
|
309 | + $whereCondition = $relationEntityAlias . '.' . $fieldName . ' ' . $operator['meta'] . ' :field_' . $fieldName . $salt; |
|
310 | 310 | } |
311 | 311 | |
312 | 312 | $this->qBuilder->andWhere($whereCondition); |
@@ -334,7 +334,7 @@ discard block |
||
334 | 334 | $fieldName = $this->parser->camelize($filtering->getFieldName()); |
335 | 335 | |
336 | 336 | $operator = Operators::getDefaultOperator(); |
337 | - if($filtering->hasOperator()) { |
|
337 | + if ($filtering->hasOperator()) { |
|
338 | 338 | $operator = Operators::get($filtering->getOperator()); |
339 | 339 | } |
340 | 340 | |
@@ -351,18 +351,18 @@ discard block |
||
351 | 351 | |
352 | 352 | if ($filtering->hasOperator()) { |
353 | 353 | if ('list' == $filtering->getOperator()) { |
354 | - $whereCondition = $this->entityAlias.'.'.$fieldName.' '.$operator['meta'].' (:field_'.$fieldName . $salt . ')'; |
|
354 | + $whereCondition = $this->entityAlias . '.' . $fieldName . ' ' . $operator['meta'] . ' (:field_' . $fieldName . $salt . ')'; |
|
355 | 355 | } else if ('field_eq' == $filtering->getOperator()) { |
356 | 356 | $whereCondition = |
357 | - $this->entityAlias . '.' . $fieldName . ' '. |
|
357 | + $this->entityAlias . '.' . $fieldName . ' ' . |
|
358 | 358 | $operator['meta'] . '' . |
359 | 359 | $this->entityAlias . '.' . $value |
360 | 360 | ; |
361 | 361 | } else { |
362 | - $whereCondition = $this->entityAlias.'.'.$fieldName.' '.$operator['meta'].' :field_'.$fieldName . $salt; |
|
362 | + $whereCondition = $this->entityAlias . '.' . $fieldName . ' ' . $operator['meta'] . ' :field_' . $fieldName . $salt; |
|
363 | 363 | } |
364 | 364 | } else { |
365 | - $whereCondition = $this->entityAlias.'.'.$fieldName.' = :field_'.$fieldName . $salt; |
|
365 | + $whereCondition = $this->entityAlias . '.' . $fieldName . ' = :field_' . $fieldName . $salt; |
|
366 | 366 | } |
367 | 367 | |
368 | 368 | if ($orCondition['orCondition'] != null) { |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | } else { |
391 | 391 | $isNotARelation = 0 !== strpos($fieldName, 'Embedded.'); |
392 | 392 | if ($isNotARelation) { |
393 | - $whereCondition = $this->entityAlias.'.'.$fieldName.' '.$operator['meta'].' ' . $this->entityAlias . '.' . $value; |
|
393 | + $whereCondition = $this->entityAlias . '.' . $fieldName . ' ' . $operator['meta'] . ' ' . $this->entityAlias . '.' . $value; |
|
394 | 394 | if ($orCondition['orCondition'] != null) { |
395 | 395 | $orCondition['orCondition'] .= ' OR ' . $whereCondition; |
396 | 396 | } else { |
@@ -407,7 +407,7 @@ discard block |
||
407 | 407 | $relationEntityAlias = $this->getRelationEntityAlias(); |
408 | 408 | |
409 | 409 | $embeddedFields = explode('.', $fieldName); |
410 | - $fieldName = $this->parser->camelize($embeddedFields[count($embeddedFields)-1]); |
|
410 | + $fieldName = $this->parser->camelize($embeddedFields[count($embeddedFields) - 1]); |
|
411 | 411 | |
412 | 412 | $salt = ''; |
413 | 413 | foreach ($this->qBuilder->getParameters() as $parameter) { |
@@ -417,9 +417,9 @@ discard block |
||
417 | 417 | } |
418 | 418 | |
419 | 419 | if ($filtering->hasOperator() && 'list' == $filtering->getOperator()) { |
420 | - $whereCondition = $relationEntityAlias.'.'.$fieldName.' '.$operator['meta'].' (:field_'.$fieldName . $salt . ')'; |
|
420 | + $whereCondition = $relationEntityAlias . '.' . $fieldName . ' ' . $operator['meta'] . ' (:field_' . $fieldName . $salt . ')'; |
|
421 | 421 | } else { |
422 | - $whereCondition = $relationEntityAlias.'.'.$fieldName.' '.$operator['meta'].' :field_'.$fieldName . $salt; |
|
422 | + $whereCondition = $relationEntityAlias . '.' . $fieldName . ' ' . $operator['meta'] . ' :field_' . $fieldName . $salt; |
|
423 | 423 | } |
424 | 424 | |
425 | 425 | if ($orCondition['orCondition'] != null) { |
@@ -461,7 +461,7 @@ discard block |
||
461 | 461 | |
462 | 462 | if (in_array($fieldName, $this->fields)) { |
463 | 463 | $direction = ($val === self::DIRECTION_AZ) ? self::DIRECTION_AZ : self::DIRECTION_ZA; |
464 | - $this->qBuilder->addOrderBy($this->entityAlias .'.'. $fieldName, $direction); |
|
464 | + $this->qBuilder->addOrderBy($this->entityAlias . '.' . $fieldName, $direction); |
|
465 | 465 | } |
466 | 466 | |
467 | 467 | if (strstr($sort, '_embedded.')) { |
@@ -472,7 +472,7 @@ discard block |
||
472 | 472 | $fieldName = $this->parser->camelize($embeddedFields[2]); |
473 | 473 | $direction = ($val === self::DIRECTION_AZ) ? self::DIRECTION_AZ : self::DIRECTION_ZA; |
474 | 474 | |
475 | - $this->qBuilder->addOrderBy($relationEntityAlias.'.'.$fieldName, $direction); |
|
475 | + $this->qBuilder->addOrderBy($relationEntityAlias . '.' . $fieldName, $direction); |
|
476 | 476 | } |
477 | 477 | |
478 | 478 | } |