Change repository naming to avoid naming conflicts

This commit is contained in:
Art4 2025-05-20 08:46:41 +00:00
parent febcdd72c7
commit 02fb800d12
13 changed files with 186 additions and 177 deletions

View file

@ -1,54 +0,0 @@
<?php
// Copyright (C) 2010-2024, the Friendica project
// SPDX-FileCopyrightText: 2010-2024 the Friendica project
//
// SPDX-License-Identifier: AGPL-3.0-or-later
declare(strict_types=1);
namespace Friendica\Repository;
use Exception;
use Friendica\Database\Database;
use Friendica\Database\DatabaseException;
use Friendica\Database\Repository\DeletedUserRepository;
/**
* Repository for deleted users
*/
final class UserdRepository implements DeletedUserRepository
{
private Database $database;
public function __construct(Database $database)
{
$this->database = $database;
}
/**
* Insert a deleted user by username.
*
* @throws DatabaseException If the username could not be inserted
*/
public function insertByUsername(string $username): void
{
$throw = $this->database->throwExceptionsOnErrors(true);
try {
$this->database->insert('userd', ['username' => $username]);
} finally {
$this->database->throwExceptionsOnErrors($throw);
}
}
/**
* Check if a deleted username exists.
*
* @throws \Exception
*/
public function existsByUsername(string $username): bool
{
return $this->database->exists('userd', ['username' => $username]);
}
}