Tweak some PHPDocs

This commit is contained in:
Alex Cabal 2024-05-18 20:41:15 -05:00
parent cb9ff01615
commit 4cd7a1b72c
2 changed files with 5 additions and 3 deletions

View file

@ -21,7 +21,9 @@ class Db{
/** /**
* Returns a single integer value for the first column database query result. * Returns a single integer value for the first column database query result.
* This is useful for queries that return a single integer as a result, like count(*) or sum(*). *
* This is useful for queries that return a single integer as a result, like `count(*)` or `sum(*)`.
*
* @param string $query * @param string $query
* @param array<mixed> $args * @param array<mixed> $args
*/ */

View file

@ -138,7 +138,7 @@ class DbConnection{
* ] * ]
* ``` * ```
* *
* **Important note:** When joining against two tables, SQL only returns one column for the join key (typically an ID value). Therefore, if both objects require an ID, the filler method must explicitly assign the ID to one of the two objects that's missing it. The above example shows this behavior: note how we join on UserId, but only the Users result has the UserId column, even though the Posts table also has a UserId column. * **Important note:** When joining against two tables, SQL only returns one column for the join key (typically an ID value). Therefore, if both objects require an ID, the filler method must explicitly assign the ID to one of the two objects that's missing it. The above example shows this behavior: note how we join on `UserId`, but only the `Users` result has the `UserId` column, even though the `Posts` table also has a `UserId` column.
* *
* @template T * @template T
* *
@ -148,7 +148,7 @@ class DbConnection{
* *
* @return array<T>|array<array<mixed>> An array of `$class` if `$class` is not `null`, otherwise an array of rows. * @return array<T>|array<array<mixed>> An array of `$class` if `$class` is not `null`, otherwise an array of rows.
* *
* @throws Exceptions\AppException If a class was specified but the class doesn't have a `FromMultiTableRow` method. * @throws Exceptions\AppException 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. * @throws Exceptions\DatabaseQueryException When an error occurs during execution of the query.
*/ */
public function MultiTableSelect(string $sql, array $params = [], ?string $class = null): array{ public function MultiTableSelect(string $sql, array $params = [], ?string $class = null): array{