Skip to content

Commit

Permalink
Fixed query
Browse files Browse the repository at this point in the history
  • Loading branch information
pierrerolland committed Feb 5, 2018
1 parent ad9557c commit a37421b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Builder/EntityBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ private function retrieveAssociationValue($fromClass, $targetClass, array $reque
}
}
if (count($search) === count($identifiers)) {
$value = $repo->findBy($search);
$value = $repo->findOneBy($search);
if (!$value) {
$value = new $targetClass();
}
Expand Down
2 changes: 1 addition & 1 deletion ParamConverter/EntityParamConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function apply(Request $request, ParamConverter $configuration)
}

if (count($search) === count($identifiers)) {
$entity = $this->entityManager->getRepository($configuration->getClass())->findBy($search);
$entity = $this->entityManager->getRepository($class)->findOneBy($search);
if (!$entity) {
$entity = new $class();
}
Expand Down

0 comments on commit a37421b

Please sign in to comment.