Skip to content

Commit

Permalink
Retrieve only single db row
Browse files Browse the repository at this point in the history
  • Loading branch information
ochorocho committed Jan 15, 2025
1 parent 6dfde3e commit c54c455
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Classes/Domain/Repository/JobRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ public function findOneRunning(): ?Job
->orderBy('created_time', 'ASC')
->setMaxResults(1)
->executeQuery()
->fetchAllAssociative();
if ($row === []) {
->fetchAssociative();
if ($row === false) {
return null;
}
return (new Job())->fromDatabaseRow($row);
Expand All @@ -88,9 +88,9 @@ public function findOneWaiting(): ?Job
->orderBy('created_time', 'ASC')
->setMaxResults(1)
->executeQuery()
->fetchAllAssociative();
->fetchAssociative();

if ($row === []) {
if ($row === false) {
return null;
}
return (new Job())->fromDatabaseRow($row);
Expand Down

0 comments on commit c54c455

Please sign in to comment.