forked from GNUsocial/gnu-social
[DB][DOCUMENTATION] Explain limit: 2 in findOneBy
This commit is contained in:
parent
fb861ed41f
commit
e30ae79eb7
@ -175,7 +175,7 @@ abstract class DB
|
||||
*/
|
||||
public static function findOneBy(string $table, array $criteria, ?array $orderBy = null, ?int $offset = null)
|
||||
{
|
||||
$res = self::findBy($table, $criteria, $orderBy, 2, $offset);
|
||||
$res = self::findBy($table, $criteria, $orderBy, 2, $offset); // Use limit 2 to check for consistency
|
||||
switch (count($res)) {
|
||||
case 0:
|
||||
throw new NotFoundException("No value in table {$table} matches the requested criteria");
|
||||
|
Loading…
Reference in New Issue
Block a user