|
|
@ -26,8 +26,8 @@ class TorrentRepository extends ServiceEntityRepository |
|
|
|
array $locales, |
|
|
|
array $locales, |
|
|
|
?bool $sensitive = null, |
|
|
|
?bool $sensitive = null, |
|
|
|
?bool $approved = null, |
|
|
|
?bool $approved = null, |
|
|
|
int $limit = 0, |
|
|
|
int $limit = 10, |
|
|
|
int $offset = 10 |
|
|
|
int $offset = 0 |
|
|
|
): int |
|
|
|
): int |
|
|
|
{ |
|
|
|
{ |
|
|
|
return $this->getTorrentsQueryByFilter( |
|
|
|
return $this->getTorrentsQueryByFilter( |
|
|
@ -45,8 +45,8 @@ class TorrentRepository extends ServiceEntityRepository |
|
|
|
array $locales, |
|
|
|
array $locales, |
|
|
|
?bool $sensitive = null, |
|
|
|
?bool $sensitive = null, |
|
|
|
?bool $approved = null, |
|
|
|
?bool $approved = null, |
|
|
|
int $limit = 0, |
|
|
|
int $limit = 10, |
|
|
|
int $offset = 10 |
|
|
|
int $offset = 0 |
|
|
|
): array |
|
|
|
): array |
|
|
|
{ |
|
|
|
{ |
|
|
|
return $this->getTorrentsQueryByFilter( |
|
|
|
return $this->getTorrentsQueryByFilter( |
|
|
@ -55,10 +55,10 @@ class TorrentRepository extends ServiceEntityRepository |
|
|
|
$sensitive, |
|
|
|
$sensitive, |
|
|
|
$approved, |
|
|
|
$approved, |
|
|
|
)->setMaxResults($limit) |
|
|
|
)->setMaxResults($limit) |
|
|
|
->setFirstResult($offset) |
|
|
|
->setFirstResult($offset) |
|
|
|
->orderBy('t.id', 'DESC') // same as t.added |
|
|
|
->orderBy('t.id', 'DESC') // same as t.added |
|
|
|
->getQuery() |
|
|
|
->getQuery() |
|
|
|
->getResult(); |
|
|
|
->getResult(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private function getTorrentsQueryByFilter( |
|
|
|
private function getTorrentsQueryByFilter( |
|
|
|