Skip to content

Commit

Permalink
pkp#8885 Stage Assignments model pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitaliy-1 committed Apr 27, 2024
1 parent 27b8e2d commit 8fbc050
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions classes/submission/maps/Schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,6 @@ protected function getPropertyReviewAssignments(Enumerable $reviewAssignments):
$reviews[] = [
'id' => (int) $reviewAssignment->getId(),
'isCurrentUserAssigned' => $currentUser->getId() == (int) $reviewAssignment->getReviewerId(),
'dateAssigned' => $reviewAssignment->getData('dateAssigned'),
'statusId' => (int) $reviewAssignment->getStatus(),
'status' => __($reviewAssignment->getStatusKey()),
'dateDue' => $dateDue,
Expand Down Expand Up @@ -648,14 +647,14 @@ protected function getUserGroup(int $userGroupId): ?UserGroup
*
* @param Enumerable<Submission> $submissions
*
* @return LazyCollection<StageAssignment> The collection of stage assignments associated with submissions
* @return Collection<StageAssignment> The collection of stage assignments associated with submissions
*/
protected function getStageAssignmentsBySubmissions(Enumerable $submissions, array $roleIds = []): LazyCollection
protected function getStageAssignmentsBySubmissions(Enumerable $submissions, array $roleIds = []): Collection
{
$submissionIds = $submissions->map(fn (Submission $submission) => $submission->getId())->toArray();

$stageAssignmentDao = DAORegistry::getDAO('StageAssignmentDAO'); /** @var StageAssignmentDAO $stageAssignmentDao */
return $stageAssignmentDao->getCurrentBySubmissionIds($submissionIds, $roleIds)->remember();
return StageAssignment::withSubmissionIds([$submissionIds])
->withRoleIds($roleIds)
->get();
}

/**
Expand Down

0 comments on commit 8fbc050

Please sign in to comment.