Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)),
Comment thread
rjzondervan marked this conversation as resolved.
Resolved
$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