Skip to content

Commit efc9c06

Browse files
committed
fix(Assignments): Minor fixes to get things to run
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
1 parent b5fc9b4 commit efc9c06

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

lib/Db/AssignmentMapper.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function __construct(
3636
*/
3737
public function find(string $userId, int $assignmentId): Assignment {
3838
$qb = $this->db->getQueryBuilder();
39-
$qb->select('id')
39+
$qb->select(Assignment::$columns)
4040
->from($this->getTableName())
4141
->where($qb->expr()->eq('id', $qb->createPositionalParameter($assignmentId, IQueryBuilder::PARAM_INT)))
4242
->andWhere($qb->expr()->eq('user_id', $qb->createPositionalParameter($userId, IQueryBuilder::PARAM_STR)));
@@ -69,7 +69,7 @@ public function findForUser(string $userId): \Generator {
6969
->where($qb->expr()->eq('user_id', $qb->createPositionalParameter($userId, IQueryBuilder::PARAM_STR)))
7070
->orderBy('created_at', 'DESC');
7171

72-
yield * $this->yieldEntities($qb);
72+
yield from $this->yieldEntities($qb);
7373
}
7474

7575
/**
@@ -78,6 +78,9 @@ public function findForUser(string $userId): \Generator {
7878
*/
7979
public function findDueAssignmentsForUser(string $userId): \Generator {
8080
foreach ($this->findForUser($userId) as $assignment) {
81+
if ($assignment === null) {
82+
continue;
83+
}
8184
if (!$assignment->isDueToRun($this->timeFactory->now())) {
8285
continue;
8386
}

0 commit comments

Comments
 (0)