Bicycle/App/Repositories/UserRepository.php
2026-08-11 22:35:26 +03:00

39 lines
1.2 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
/**
* @package Bicycle
* @author Egor Isaev
* @description UserRepository.php
* @copyright (c) 11/08/2026
*/
namespace App\Repositories;
use System\Classes\Repository;
/**
* Репозиторий таблицы users.
*/
class UserRepository extends Repository
{
/**
* @param string|null $connection Имя подключения (Database::instance($connection)); null — по умолчанию
*/
public function __construct(?string $connection = null)
{
parent::__construct('users', connection: $connection);
}
/**
* Строка users по логину Services\Auth (сопоставление авторизованного пользователя
* с владельцем бюджета — см. бюджет_текущий_план.md, users.login отдельно от реальной
* авторизации, только для связи с этой строкой).
*
* @param string $login
* @return object|false
*/
public function getByLogin(string $login): mixed
{
return $this->getItemWhere('login = ' . $this->pdo->pdo()->quote($login));
}
}