mirror of
https://github.com/standardebooks/web.git
synced 2025-07-07 07:10:29 -04:00
Add missing MultiTableSelect code
This commit is contained in:
parent
d0d79d637c
commit
93b8008c7e
4 changed files with 24 additions and 6 deletions
19
lib/Db.php
19
lib/Db.php
|
@ -19,6 +19,25 @@ class Db{
|
|||
return $GLOBALS['DbConnection']->Query($query, $args, $class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute a select query that returns a join against multiple tables.
|
||||
*
|
||||
* @template T
|
||||
*
|
||||
* @param string $sql The SQL query to execute.
|
||||
* @param array<mixed> $params An array of parameters to bind to the SQL statement.
|
||||
* @param class-string<T> $class The class to instantiate for each row, or `null` to return an array of rows.
|
||||
*
|
||||
* @return array<T> An array of `$class`.
|
||||
*
|
||||
* @throws Exceptions\MultiSelectMethodNotFoundException If a class was specified but the class doesn't have a `FromMultiTableRow()` method.
|
||||
* @throws Exceptions\DatabaseQueryException When an error occurs during execution of the query.
|
||||
*/
|
||||
public static function MultiTableSelect(string $sql, array $params, string $class): array{
|
||||
/** @throws Exceptions\DatabaseQueryException|Exceptions\MultiSelectMethodNotFoundException */
|
||||
return $GLOBALS['DbConnection']->MultiTableSelect($sql, $params, $class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a single integer value for the first column database query result.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue