@@ -27,7 +27,7 @@ |
||
| 27 | 27 | $this->router = $router; |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | - public function paginateResults ( |
|
| 30 | + public function paginateResults( |
|
| 31 | 31 | QueryBuilderOptions $queryOptions, |
| 32 | 32 | DoctrineORMAdapter $ormAdapter, |
| 33 | 33 | PagerfantaBuilder $pagerfantaBuilder, |
@@ -152,11 +152,11 @@ |
||
| 152 | 152 | $parameters = $andFilterFactory->getParameters(); |
| 153 | 153 | $innerJoins = $andFilterFactory->getInnerJoin(); |
| 154 | 154 | |
| 155 | - foreach($conditions as $condition) { |
|
| 155 | + foreach ($conditions as $condition) { |
|
| 156 | 156 | $this->qBuilder->andWhere($condition); |
| 157 | 157 | } |
| 158 | 158 | |
| 159 | - foreach($parameters as $parameter) { |
|
| 159 | + foreach ($parameters as $parameter) { |
|
| 160 | 160 | $this->qBuilder->setParameter($parameter['field'], $parameter['value']); |
| 161 | 161 | } |
| 162 | 162 | |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | |
| 31 | 31 | $this->conditions = ''; |
| 32 | 32 | $this->parameters = []; |
| 33 | - $this->parser = new StringParser(); |
|
| 33 | + $this->parser = new StringParser(); |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | public function createFilter(array $orFilters) |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | |
| 29 | 29 | $this->conditions = []; |
| 30 | 30 | $this->parameters = []; |
| 31 | - $this->parser = new StringParser(); |
|
| 31 | + $this->parser = new StringParser(); |
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | public function createFilter(array $andFilters) |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | . $filterObject->getOperatorMeta(); |
| 115 | 115 | |
| 116 | 116 | if ($filterObject->isListContainsType()) { |
| 117 | - $fieldName = $this->relationEntityAlias . '.' . $embeddedFieldName; |
|
| 117 | + $fieldName = $this->relationEntityAlias . '.' . $embeddedFieldName; |
|
| 118 | 118 | $whereCondition = $this->createWhereConditionForListContains($value, $fieldName, $embeddedFieldName, $salt); |
| 119 | 119 | } elseif ($filterObject->isListType()) { |
| 120 | 120 | $whereCondition .= ' (:field_' . $embeddedFieldName . $salt . ')'; |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | if ($whereCondition == '') { |
| 171 | 171 | $whereCondition = ' ('; |
| 172 | 172 | } else { |
| 173 | - $whereCondition .= ' OR '; |
|
| 173 | + $whereCondition .= ' OR '; |
|
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | $whereCondition .= $fieldName . |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | |
| 33 | 33 | public static function dotNotationFor(string $class) |
| 34 | 34 | { |
| 35 | - $dottedFullyQualifiedClassName = str_replace( '\\', '.', $class); |
|
| 35 | + $dottedFullyQualifiedClassName = str_replace('\\', '.', $class); |
|
| 36 | 36 | return strtolower($dottedFullyQualifiedClassName); |
| 37 | 37 | } |
| 38 | 38 | } |
@@ -69,21 +69,21 @@ discard block |
||
| 69 | 69 | |
| 70 | 70 | private static $operatorMap = [ |
| 71 | 71 | |
| 72 | - self::NUMBER_EQUAL => [ 'meta' => ' =' ], |
|
| 73 | - self::NUMBER_NOT_EQUAL => [ 'meta' => '!=' ], |
|
| 74 | - self::NUMBER_GREATER => [ 'meta' => '>' ], |
|
| 75 | - self::NUMBER_GREATER_EQUAL => [ 'meta' => '>=' ], |
|
| 76 | - self::NUMBER_LITTLE => [ 'meta' => '<' ], |
|
| 77 | - self::NUMBER_LITTLE_EQUAL => [ 'meta' => '<=' ], |
|
| 78 | - |
|
| 79 | - self::STRING_STARTS_WITH => [ 'meta' => 'LIKE', 'substitution_pattern' => '{string}%' ], |
|
| 80 | - self::STRING_CONTAINS => [ 'meta' => 'LIKE', 'substitution_pattern' => '%{string}%' ], |
|
| 81 | - self::STRING_NOT_CONTAINS => [ 'meta' => 'NOT LIKE', 'substitution_pattern' => '%{string}%' ], |
|
| 82 | - self::STRING_ENDS_WITH => [ 'meta' => 'LIKE', 'substitution_pattern' => '%{string}' ], |
|
| 83 | - |
|
| 84 | - self::FIELD_LIST => [ 'meta' => 'IN', 'substitution_pattern' => '({string})' ], |
|
| 85 | - self::FIELD_NOT_IN_LIST => [ 'meta' => 'NOT IN', 'substitution_pattern' => '({string})' ], |
|
| 86 | - self::FIELD_EQUALITY => [ 'meta' => '=' ], |
|
| 72 | + self::NUMBER_EQUAL => ['meta' => ' ='], |
|
| 73 | + self::NUMBER_NOT_EQUAL => ['meta' => '!='], |
|
| 74 | + self::NUMBER_GREATER => ['meta' => '>'], |
|
| 75 | + self::NUMBER_GREATER_EQUAL => ['meta' => '>='], |
|
| 76 | + self::NUMBER_LITTLE => ['meta' => '<'], |
|
| 77 | + self::NUMBER_LITTLE_EQUAL => ['meta' => '<='], |
|
| 78 | + |
|
| 79 | + self::STRING_STARTS_WITH => ['meta' => 'LIKE', 'substitution_pattern' => '{string}%'], |
|
| 80 | + self::STRING_CONTAINS => ['meta' => 'LIKE', 'substitution_pattern' => '%{string}%'], |
|
| 81 | + self::STRING_NOT_CONTAINS => ['meta' => 'NOT LIKE', 'substitution_pattern' => '%{string}%'], |
|
| 82 | + self::STRING_ENDS_WITH => ['meta' => 'LIKE', 'substitution_pattern' => '%{string}'], |
|
| 83 | + |
|
| 84 | + self::FIELD_LIST => ['meta' => 'IN', 'substitution_pattern' => '({string})'], |
|
| 85 | + self::FIELD_NOT_IN_LIST => ['meta' => 'NOT IN', 'substitution_pattern' => '({string})'], |
|
| 86 | + self::FIELD_EQUALITY => ['meta' => '='], |
|
| 87 | 87 | |
| 88 | 88 | 'isnull' => [ |
| 89 | 89 | 'meta' => 'IS NULL', |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | { |
| 125 | 125 | if (!isset(self::$doctrineTypeToOperatorsMap[$type])) { |
| 126 | 126 | throw new \RuntimeException( |
| 127 | - 'Oops! Type "'.$type.'" is not yet defined.' |
|
| 127 | + 'Oops! Type "' . $type . '" is not yet defined.' |
|
| 128 | 128 | ); |
| 129 | 129 | } |
| 130 | 130 | } |
@@ -285,7 +285,7 @@ |
||
| 285 | 285 | ->getQuery() |
| 286 | 286 | ->getSingleScalarResult(); |
| 287 | 287 | |
| 288 | - return [ 'count' => $count ]; |
|
| 288 | + return ['count' => $count]; |
|
| 289 | 289 | } |
| 290 | 290 | |
| 291 | 291 | $this->lastQuery = $queryBuilder->getQuery()->getSql(); |