Skip to content

Commit

Permalink
Get count of users
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesread committed Aug 21, 2023
1 parent f08f70f commit 1178175
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/main/php/libAllure/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -327,4 +327,15 @@ public static function getAllLocalUsers()

return $stmt->fetchAll();
}

public static function getCountLocalUsers(): int
{
$sql = 'SELECT count(id) AS count FROM users';
$stmt = DatabaseFactory::getInstance()->prepare($sql);
$stmt->execute();

$row = $stmt->fetchRow();

return intval($row['count']);
}
}

0 comments on commit 1178175

Please sign in to comment.