Compare commits

..

2 commits

Author SHA1 Message Date
mrilyew
adb1ff4db3 задушнил 2025-03-05 20:44:12 +03:00
mrilyew
e4904347c4 linter errors fix 2025-03-05 20:38:06 +03:00

View file

@ -13,7 +13,7 @@ class Faves
private $context;
private $likes;
private function __construct()
public function __construct()
{
$this->context = DatabaseConnection::i()->getContext();
$this->likes = $this->context->table("likes");
@ -29,13 +29,13 @@ class Faves
return $fetch;
}
public function fetchLikesSection(User $user, string $class = 'Post', int $page = 1, ?int $perPage = NULL): \Traversable
public function fetchLikesSection(User $user, string $class = 'Post', int $page = 1, ?int $perPage = null): \Traversable
{
$perPage ??= OPENVK_DEFAULT_PER_PAGE;
$fetch = $this->fetchLikes($user, $class)->page($page, $perPage)->order("index DESC");
foreach ($fetch as $like) {
$className = "openvk\\Web\\Models\\Repositories\\" . $class . "s";
$repo = new $className;
$repo = new $className();
if (!$repo) {
continue;
}