[DB][DOCUMENTATION] Explain limit: 2 in findOneBy

This commit is contained in:
Hugo Sales 2021-08-16 17:07:00 +01:00
parent c3db2f60d2
commit fe86735b8b
Signed by: someonewithpc
GPG Key ID: 7D0C7EAFC9D835A0
1 changed files with 1 additions and 1 deletions

View File

@ -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");