Skip to content
Closed
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public function getAllByExternalSessionId(string $sid): array
*/
public function destroySession(string $sid): void
{
$dql = 'DELETE FROM ' . ExternalSessionEntityInterface::class . ' es'
$dql = 'DELETE FROM ' . \VuFind\Db\Entity\ExternalSession::class . ' es'
. ' WHERE es.sessionId = :sid';
$query = $this->entityManager->createQuery($dql);
$query->setParameter('sid', $sid);
Expand Down
7 changes: 3 additions & 4 deletions module/VuFind/src/VuFind/Db/Service/ResourceService.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
use VuFind\Db\Entity\ResourceTagsEntityInterface;
use VuFind\Db\Entity\UserEntityInterface;
use VuFind\Db\Entity\UserListEntityInterface;
use VuFind\Db\Entity\UserResourceEntityInterface;
use VuFind\Db\PersistenceManager;
use VuFind\Log\LoggerAwareTrait;

Expand Down Expand Up @@ -213,15 +212,15 @@ public function getFavorites(
?int $limit = null,
bool $caseSensitiveTags = false
): array {
$user = $this->getDoctrineReference(UserEntityInterface::class, $userOrId);
$user = $this->getDoctrineReference(\VuFind\Db\Entity\User::class, $userOrId);
$list = $listOrId ? $this->getDoctrineReference(UserListEntityInterface::class, $listOrId) : null;
$orderByDetails = empty($sort) ? [] : $this->getResourceOrderByClause($sort);
$dql = 'SELECT DISTINCT r';
if (!empty($orderByDetails['extraSelect'])) {
$dql .= ', ' . $orderByDetails['extraSelect'];
}
$dql .= ' FROM ' . ResourceEntityInterface::class . ' r '
. 'JOIN ' . UserResourceEntityInterface::class . ' ur WITH r.id = ur.resource ';
$dql .= ' FROM ' . \VuFind\Db\Entity\Resource::class . ' r '
. 'JOIN ' . \VuFind\Db\Entity\UserResource::class . ' ur WITH r.id = ur.resource ';
$dqlWhere = [];
$dqlWhere[] = 'ur.user = :user';
$parameters = compact('user');
Expand Down
10 changes: 5 additions & 5 deletions module/VuFind/src/VuFind/Db/Service/UserService.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public function createEntityForUsername(string $username): UserEntityInterface
public function deleteUser(UserEntityInterface|int $userOrId): void
{
$userId = $userOrId instanceof UserEntityInterface ? $userOrId->getId() : $userOrId;
$dql = 'DELETE FROM ' . UserEntityInterface::class . ' u'
$dql = 'DELETE FROM ' . \VuFind\Db\Entity\User::class . ' u'
. ' WHERE u.id = :id';
$query = $this->entityManager->createQuery($dql);
$query->setParameter('id', $userId);
Expand All @@ -121,7 +121,7 @@ public function deleteUser(UserEntityInterface|int $userOrId): void
public function getUserById(int $id): ?UserEntityInterface
{
$dql = 'SELECT u '
. 'FROM ' . UserEntityInterface::class . ' u '
. 'FROM ' . \VuFind\Db\Entity\User::class . ' u '
. 'WHERE u.id = :id';
$query = $this->entityManager->createQuery($dql);
$query->setParameter('id', $id);
Expand Down Expand Up @@ -158,7 +158,7 @@ public function getUserByField(string $fieldName, int|string|null $fieldValue):
$where = $caseInsensitive
? 'LOWER(U.' . $legalFieldMap[$fieldName] . ') = LOWER(:fieldValue)'
: 'U.' . $legalFieldMap[$fieldName] . ' = :fieldValue';
$dql = 'SELECT U FROM ' . UserEntityInterface::class . ' U '
$dql = 'SELECT U FROM ' . \VuFind\Db\Entity\User::class . ' U '
. 'WHERE ' . $where;
$parameters = compact('fieldValue');
$query = $this->entityManager->createQuery($dql);
Expand Down Expand Up @@ -318,7 +318,7 @@ public function hasUserSessionData(): bool
public function getAllUsersWithCatUsernames(): array
{
$dql = 'SELECT u '
. 'FROM ' . UserEntityInterface::class . ' u '
. 'FROM ' . \VuFind\Db\Entity\User::class . ' u '
. 'WHERE u.catUsername IS NOT NULL';
$query = $this->entityManager->createQuery($dql);
$result = $query->getResult();
Expand All @@ -333,7 +333,7 @@ public function getAllUsersWithCatUsernames(): array
public function getInsecureRows(): array
{
$dql = 'SELECT u '
. 'FROM ' . UserEntityInterface::class . ' u '
. 'FROM ' . \VuFind\Db\Entity\User::class . ' u '
. "WHERE u.password != '' "
. 'AND u.catPassword IS NOT NULL';
$query = $this->entityManager->createQuery($dql);
Expand Down