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

Limits on hasMany elements applies on the total, not the individual hasMany #362

Open
spl1nes opened this issue Feb 2, 2024 · 0 comments

Comments

@spl1nes
Copy link
Member

spl1nes commented Feb 2, 2024

The following request only returns 1 taskElement but it should return up to 1 taskElement per task.

$tasks = TaskMapper::getAll()
            ->with('tags')
            ->with('tags/title')
            ->with('taskElements')
            ->where('title', '%' . ($request->getDataString('search') ?? '') . '%', 'LIKE')
            ->where('tags/title/language', $response->header->l11n->language)
            ->sort('createdAt', OrderType::DESC)
            ->sort('taskElements/createdAt', OrderType::ASC)
            ->limit(25)
            ->limit(1, 'taskElements') 
            ->execute();
@spl1nes spl1nes added this to Todo list Feb 2, 2024
@spl1nes spl1nes converted this from a draft issue Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

1 participant