diff --git a/Web/Models/Repositories/Clubs.php b/Web/Models/Repositories/Clubs.php index 04bb30abd..d77eac638 100644 --- a/Web/Models/Repositories/Clubs.php +++ b/Web/Models/Repositories/Clubs.php @@ -53,7 +53,7 @@ function find(string $query, array $pars = [], string $sort = "id DESC", int $pa function getCount(): int { - return sizeof(clone $this->clubs); + return (clone $this->clubs)->count('*'); } function getPopularClubs(): \Traversable diff --git a/Web/Models/Repositories/Posts.php b/Web/Models/Repositories/Posts.php index 89ee58eaa..fb32fe6e5 100644 --- a/Web/Models/Repositories/Posts.php +++ b/Web/Models/Repositories/Posts.php @@ -252,6 +252,6 @@ function getSuggestedPostsCountByUser(int $club, int $user): int function getCount(): int { - return sizeof(clone $this->posts); + return (clone $this->posts)->count('*'); } } diff --git a/Web/Models/Repositories/Users.php b/Web/Models/Repositories/Users.php index d2f4500ec..8e29d8663 100644 --- a/Web/Models/Repositories/Users.php +++ b/Web/Models/Repositories/Users.php @@ -142,9 +142,9 @@ function find(string $query, array $pars = [], string $sort = "id DESC"): Util\E function getStatistics(): object { return (object) [ - "all" => sizeof(clone $this->users), - "active" => sizeof((clone $this->users)->where("online > 0")), - "online" => sizeof((clone $this->users)->where("online >= ?", time() - 900)), + "all" => (clone $this->users)->count('*'), + "active" => (clone $this->users)->where("online > 0")->count('*'), + "online" => (clone $this->users)->where("online >= ?", time() - 900)->count('*'), ]; }