-
Notifications
You must be signed in to change notification settings - Fork 917
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
pkp/pkp-lib#10506 user group to use eloquent model #4526
base: main
Are you sure you want to change the base?
pkp/pkp-lib#10506 user group to use eloquent model #4526
Conversation
ba596b3
to
0a46028
Compare
@Hafsa-Naeem, this won't trigger tests. The update of submodule should be the last commit with the message:
All branches in submodule should have the same name: https://docs.pkp.sfu.ca/dev/testing/en/continuous-integration#tests-for-pull-requests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @Hafsa-Naeem! I left minor comments. Submodule updates require specific commit message and this commit should be last. I. think you can reset the last commit and divide it into 2 separate with the last one to include submodule updates to the shared library, ui library and plugins
$contextId = $request->getContext()->getId(); | ||
|
||
$userGroups = UserGroup::withContextIds($contextId) | ||
->whereHas('userGroupStages', function ($query) use ($stageId) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that you already created helper in the Repository:
PKP\userGroup\Repository::getUserGroupsByStage()
The second option is just use the scope, that is also already created:
UserGroup::withContextIds([$contextId])->withStageIds([$stageId]);
); | ||
$contextId = $request->getContext()->getId(); | ||
|
||
$userGroups = UserGroup::withContextIds($contextId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UserGroup::withContextIds([$contextId])
->filterByContextIds([$context->getId()]) | ||
->getMany(); | ||
$contextId = $request->getContext()->getId(); | ||
$userGroups = UserGroup::withContextIds($contextId)->get(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UserGroup::withContextIds([$contextId])
No description provided.