Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EntityCollection is returned for empty results #58

Closed
TobiasGraml11 opened this issue Nov 14, 2022 · 2 comments
Closed

EntityCollection is returned for empty results #58

TobiasGraml11 opened this issue Nov 14, 2022 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@TobiasGraml11
Copy link
Contributor

When using the repositories, I can't have explicit typehints, as the general one is returned for empty results. Would be great, if the correct collection class would be returned for the corresponding repository.

Code:

$criteria1 = new Criteria();
$criteria1->setIds(['ca9f2ea7166c4ff58f42c2e100ca3fd5']);

$criteria2 = new Criteria();
$criteria2->setIds(['0134e8fa91da44c7b5418806d7b95c21']);

/** @var CategoryCollection $categories */
$categories1 = $this->categoryRepository
    ->search($criteria1, $this->context)
    ->getEntities();

$categories2 = $this->categoryRepository
    ->search($criteria2, $this->context)
    ->getEntities();

Result:
image

@vienthuong vienthuong self-assigned this Nov 14, 2022
@vienthuong
Copy link
Owner

Hi @TobiasGraml11
Looks like a bug, I will have a look

@vienthuong vienthuong added the bug Something isn't working label Nov 14, 2022
@vienthuong
Copy link
Owner

I fixed this in latest 1.7.2 version, feel free to reopen if you have any issue with it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants