Skip to content

Commit

Permalink
Merge pull request #150 from ConductionNL/development
Browse files Browse the repository at this point in the history
Dev to main
  • Loading branch information
rjzondervan authored Jan 30, 2025
2 parents e8aab6c + b55dd9a commit 9232f90
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/Db/ObjectEntityMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class ObjectEntityMapper extends QBMapper
* @param IUserSession $userSession The user session
*/
public function __construct(
IDBConnection $db,
IDBConnection $db,
MySQLJsonService $mySQLJsonService,
IEventDispatcher $eventDispatcher,
IUserSession $userSession,
Expand Down Expand Up @@ -73,7 +73,7 @@ public function find($identifier): ObjectEntity
->from('openregister_objects')
->where(
$qb->expr()->orX(
$qb->expr()->eq('id', $qb->createNamedParameter($identifier, IQueryBuilder::PARAM_INT)),
$qb->expr()->eq('id', $qb->createNamedParameter(is_numeric($identifier) ? $identifier : -1, IQueryBuilder::PARAM_INT)),
$qb->expr()->eq('uuid', $qb->createNamedParameter($identifier, IQueryBuilder::PARAM_STR)),
$qb->expr()->eq('uri', $qb->createNamedParameter($identifier, IQueryBuilder::PARAM_STR))
)
Expand Down Expand Up @@ -469,10 +469,10 @@ public function lockObject($identifier, ?string $process = null, ?int $duration
* @throws DoesNotExistException If object not found
* @throws \Exception If unlocking fails
*/
public function unlockObject($identifier): ObjectEntity
public function unlockObject($identifier): ObjectEntity
{
$object = $this->find($identifier);

// Check if user has permission to unlock
if (!$this->userSession->isLoggedIn()) {
throw new \Exception('Must be logged in to unlock objects');
Expand Down

0 comments on commit 9232f90

Please sign in to comment.