Skip to content

Commit

Permalink
Merge pull request #66
Browse files Browse the repository at this point in the history
  • Loading branch information
williarin authored Jul 18, 2024
2 parents 9d96e8d + d4ddd8a commit 06ccd53
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
14 changes: 4 additions & 10 deletions src/Bridge/Repository/AbstractEntityRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ public function getMappedMetaKey(string $fieldName, string $entityClassName = nu
$mappedFields = $targetClass->getMappedFields();
} else {
// BC layer, to be removed when MAPPED_FIELDS constant is removed
$mappedFields = (new \ReflectionClassConstant($targetClass, 'MAPPED_FIELDS',))->getValue();
$mappedFields = (new \ReflectionClassConstant($targetClass, 'MAPPED_FIELDS'))->getValue();
}

if (
Expand Down Expand Up @@ -257,7 +257,7 @@ public function isFieldMapped(string $fieldName, string $entityClassName = null)
$mappedFields = $targetClass->getMappedFields();
} else {
// BC layer, to be removed when MAPPED_FIELDS constant is removed
$mappedFields = (new \ReflectionClassConstant($targetClass, 'MAPPED_FIELDS',))->getValue();
$mappedFields = (new \ReflectionClassConstant($targetClass, 'MAPPED_FIELDS'))->getValue();
}

if (
Expand Down Expand Up @@ -408,10 +408,7 @@ private function getWhereExpressionFromCriteriaField(
string $entityClassName = null,
int $aliasNumber = null,
): CompositeExpression {
$snakeField = u($field)
->snake()
->toString()
;
$snakeField = str_replace('.', '_', u($field) ->snake() ->toString());
$parameter = ":{$snakeField}";
$operator = '=';
$prefixedField = $field;
Expand Down Expand Up @@ -476,10 +473,7 @@ private function getWhereExpressionFromCriteriaField(
])]
private function flattenOperand(QueryBuilder $queryBuilder, Operand $operand, string $field, mixed $value): array
{
$snakeField = u($field)
->snake()
->toString()
;
$snakeField = str_replace('.', '_', u($field) ->snake() ->toString());
$parameter = ":{$snakeField}";
$operator = $operand->getOperator();

Expand Down
2 changes: 1 addition & 1 deletion src/Bridge/Repository/NormalizerTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ protected function normalizeCriteria(
$resolvedValue = $ignoreValidation
? $value
: $this->validateFieldValue($field, $value, $entityClassName);
$output[$field] = (string) $this->serializer->normalize($resolvedValue);
$output[$field] = $this->serializer->normalize($resolvedValue);
}
}

Expand Down

0 comments on commit 06ccd53

Please sign in to comment.