Регистратура объединяется со вкладкой кланы. #54. Closes #56.

This commit is contained in:
2023-07-19 15:36:13 +03:00
parent 1500eb9364
commit 92772463e6
22 changed files with 844 additions and 522 deletions

View File

@@ -2,7 +2,6 @@
namespace Core;
use Exception;
use PDO;
use PDOException;
use PDOStatement;
@@ -15,14 +14,14 @@ class Db
/**
* DB constructor.
* @throws Exception
* @throws PDOException
*/
public function __construct()
{
try {
self::$db = Database::pdoinit();
} catch (PDOException $e) {
throw new Exception($e->getMessage());
throw new PDOException($e->getMessage());
}
}
@@ -55,19 +54,20 @@ class Db
* @param string $query
* @return int
*/
static public function exec(string $query): int
public static function exec(string $query): int
{
self::init();
return self::$db->exec($query);
}
/**
* @param ?string $name [optional] Name of the sequence object from which the ID should be returned.
* @return string
*/
static public function lastInsertId(): string
public static function lastInsertId(?string $name = null): string
{
self::init();
return self::$db->lastInsertId();
return self::$db->lastInsertId($name);
}
/**