Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion VKAPI/Handlers/Audio.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ public function getCount(int $owner_id, int $uploaded_only = 0): int
->where([
"deleted" => false,
"owner" => $owner_id,
])->count();
])->count('*');
}

return (new Audios())->getUserCollectionSize($user);
Expand Down
2 changes: 1 addition & 1 deletion Web/Models/Entities/Document.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ public function isCopiedBy($user = null): bool
"owner" => $user->getRealId(),
"copy_of" => $this->getId(),
"deleted" => 0,
])->count() > 0;
])->count('*') > 0;
}

public function copy(User $user): Document
Expand Down
2 changes: 1 addition & 1 deletion Web/Models/Entities/GiftCategory.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public function hasGift(Gift $gift): bool
{
$rels = $this->getRecord()->related("gift_relations.category");

return $rels->where("gift", $gift->getId())->count() > 0;
return $rels->where("gift", $gift->getId())->count('*') > 0;
}

public function addGift(Gift $gift): void
Expand Down
2 changes: 1 addition & 1 deletion Web/Models/Entities/Playlist.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public function bookmark(RowModel $entity): bool
$id *= -1;
}

if ($this->importTable->where("entity", $id)->count() > self::MAX_COUNT) {
if ($this->importTable->where("entity", $id)->count('*') > self::MAX_COUNT) {
throw new \OutOfBoundsException("Maximum amount of playlists");
}

Expand Down
2 changes: 1 addition & 1 deletion Web/Models/Entities/Poll.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public function getVoterCount(?int $optionId = null): int
return $votes->select("COUNT(DISTINCT user) AS c")->where("poll", $this->getId())->fetch()->c;
}

return $votes->where(["poll" => $this->getId(), "option" => $optionId])->count();
return $votes->where(["poll" => $this->getId(), "option" => $optionId])->count('*');
}

public function getResults(?User $user = null): object
Expand Down
2 changes: 1 addition & 1 deletion Web/Models/Entities/Traits/TIgnorable.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function isIgnoredBy(User $user = null): bool
];

$sub = $ctx->table("ignored_sources")->where($data);
return $sub->count() > 0;
return $sub->count('*') > 0;
}

public function addIgnore(User $for_user): bool
Expand Down
6 changes: 3 additions & 3 deletions Web/Models/Entities/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -1693,7 +1693,7 @@ public function getIgnoredSources(int $offset = 0, int $limit = 10, bool $onlyId

public function getIgnoredSourcesCount()
{
return DatabaseConnection::i()->getContext()->table("ignored_sources")->where("owner", $this->getId())->count();
return DatabaseConnection::i()->getContext()->table("ignored_sources")->where("owner", $this->getId())->count('*');
}

public function isBlacklistedBy(?User $user = null): bool
Expand All @@ -1709,7 +1709,7 @@ public function isBlacklistedBy(?User $user = null): bool
];

$sub = $ctx->table("blacklist_relations")->where($data);
return $sub->count() > 0;
return $sub->count('*') > 0;
}

public function addToBlacklist(?User $user)
Expand Down Expand Up @@ -1765,7 +1765,7 @@ public function getBlacklist(int $offset = 0, int $limit = 10)

public function getBlacklistSize()
{
return DatabaseConnection::i()->getContext()->table("blacklist_relations")->where("author", $this->getId())->count();
return DatabaseConnection::i()->getContext()->table("blacklist_relations")->where("author", $this->getId())->count('*');
}

public function getEventCounters(array $list): array
Expand Down
2 changes: 1 addition & 1 deletion Web/Models/Entities/UserInfoEntities/AdditionalField.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public static function getByOwner(int $owner): \Traversable

public static function getCountByOwner(int $owner): \Traversable
{
return DatabaseConnection::i()->getContext()->table("additional_fields")->where("owner", $owner)->count();
return DatabaseConnection::i()->getContext()->table("additional_fields")->where("owner", $owner)->count('*');
}

public static function resetByOwner(int $owner): bool
Expand Down
2 changes: 1 addition & 1 deletion Web/Models/Repositories/Faves.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ public function fetchLikesSection(User $user, string $class = 'Post', int $page

public function fetchLikesSectionCount(User $user, string $class = 'Post')
{
return $this->fetchLikes($user, $class)->count();
return $this->fetchLikes($user, $class)->count('*');
}
}
2 changes: 1 addition & 1 deletion Web/Models/Repositories/Gifts.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,6 @@ public function getCategories(int $page, ?int $perPage = null, &$count = nullptr
public function getCategoriesCount(): int
{
$cats = $this->cats->where("deleted", false);
return $cats->count();
return $cats->count('*');
}
}