Skip to content

Commit

Permalink
Added order by limitation value to loadRole and loadRoleByIdentifier …
Browse files Browse the repository at this point in the history
…methods (#353)

For more details see #353

An `ORDER BY` clause for limitation values is needed to provide uniform (deterministic) limitation lookup response across all supported DBMS-es.
  • Loading branch information
ciastektk authored Apr 11, 2024
1 parent 00e8a3f commit 20717d9
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ public function loadRole(int $roleId, int $status = Role::STATUS_DEFINED): array
$this->buildRoleDraftQueryConstraint($status, $query)
)
->orderBy('p.id', 'ASC')
->addOrderBy('l.identifier', 'ASC');
->addOrderBy('l.identifier', 'ASC')
->addOrderBy('v.value', 'ASC');

return $query->execute()->fetchAllAssociative();
}
Expand All @@ -182,7 +183,8 @@ public function loadRoleByIdentifier(
$this->buildRoleDraftQueryConstraint($status, $query)
)
->orderBy('p.id', 'ASC')
->addOrderBy('l.identifier', 'ASC');
->addOrderBy('l.identifier', 'ASC')
->addOrderBy('v.value', 'ASC');

return $query->execute()->fetchAllAssociative();
}
Expand Down

0 comments on commit 20717d9

Please sign in to comment.