File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments