This commit is contained in:
2025-08-07 21:40:01 +03:00
parent d132832d28
commit 819a305fde
7 changed files with 91 additions and 64 deletions

View File

@@ -25,13 +25,13 @@
* Извлекает одну запись из базы данных и создает соответствующий объект класса.
*
* @param string $table Название таблицы.
* @param ConditionBuilder $where Условия выборки.
* @param array $columns Колонки, которые нужно включить в запрос.
* @param ConditionBuilder $where Условия выборки.
* @param string $className Полное имя класса, реализуемого интерфейсом IDBItem.
*
* @return object|false Заполненный объект класса или <code>false</code> в случае ошибки.
*/
public function GetRow (string $table, ConditionBuilder $where, array $columns = [],
public function GetRow (string $table, array $columns = [], ConditionBuilder $where = new ConditionBuilder(),
string $className = "\\StdClass"): object|false
{
// Задаю массив параметров
@@ -73,7 +73,8 @@
*
* @return false|ObjectArray Массив найденных классов или <code>false</code> в случае ошибки.
*/
public function GetRows (string $table, ConditionBuilder $where, array $columns = [],
public
function GetRows (string $table, ConditionBuilder $where, array $columns = [],
string $className = "\\StdClass"): false|ObjectArray
{
// Задаю массив параметров
@@ -122,7 +123,8 @@
*
* @see Query
*/
public function GetCol (string $table, string $column, ConditionBuilder $where): false|array
public
function GetCol (string $table, string $column, ConditionBuilder $where): false|array
{
/**
* Интерпретирую условия.
@@ -169,7 +171,8 @@
*
* @return mixed|null Результат запроса или <code>null</code> в случае ошибки.
*/
public function GetValue (string $table, string $column, ConditionBuilder $where): mixed
public
function GetValue (string $table, string $column, ConditionBuilder $where): mixed
{
// Получаю колонку по условию из таблицы
$result = $this->GetCol($table, $column, $where);