39 lines
774 B
PHP
39 lines
774 B
PHP
<?php
|
|
/**
|
|
* @package Bicycle
|
|
* @author Egor Isaev
|
|
* @description BudgetRepository.php
|
|
* @copyright (c) 07/08/2026
|
|
*/
|
|
|
|
namespace App\Repositories;
|
|
|
|
use PDO;
|
|
use System\Classes\MyException;
|
|
use System\Classes\Repository;
|
|
|
|
/**
|
|
* Пример конкретного репозитория поверх System\Classes\Repository — CRUD для таблицы budget.
|
|
*/
|
|
class BudgetRepository extends Repository
|
|
{
|
|
public function __construct()
|
|
{
|
|
parent::__construct('budget');
|
|
}
|
|
|
|
/**
|
|
* @return array
|
|
* @throws MyException
|
|
*/
|
|
public function getB(): array
|
|
{
|
|
$sql = "SELECT * FROM budget";
|
|
|
|
$stmt = $this->pdo->prepare($sql);
|
|
$stmt->execute();
|
|
|
|
return $stmt->fetchAll();
|
|
}
|
|
}
|