mirror of
https://github.com/YGGverse/YGGtracker.git
synced 2026-03-31 17:15:38 +00:00
implement user moderation tools
This commit is contained in:
parent
42cef39589
commit
8d258c677b
5 changed files with 365 additions and 26 deletions
|
|
@ -280,6 +280,27 @@ class TorrentService
|
|||
->getTorrentScrapeQueue();
|
||||
}
|
||||
|
||||
public function setTorrentsApprovedByUserId(
|
||||
int $userId,
|
||||
bool $value
|
||||
): void
|
||||
{
|
||||
foreach ($this->entityManagerInterface
|
||||
->getRepository(Torrent::class)
|
||||
->findBy(
|
||||
[
|
||||
'userId' => $userId
|
||||
]) as $torrent)
|
||||
{
|
||||
$torrent->setApproved(
|
||||
$value
|
||||
);
|
||||
|
||||
$this->entityManagerInterface->persist($torrent);
|
||||
$this->entityManagerInterface->flush();
|
||||
}
|
||||
}
|
||||
|
||||
// Torrent locale
|
||||
public function getTorrentLocales(int $id): ?TorrentLocales
|
||||
{
|
||||
|
|
@ -352,6 +373,27 @@ class TorrentService
|
|||
return $torrentLocales;
|
||||
}
|
||||
|
||||
public function setTorrentLocalesApprovedByUserId(
|
||||
int $userId,
|
||||
bool $value
|
||||
): void
|
||||
{
|
||||
foreach ($this->entityManagerInterface
|
||||
->getRepository(TorrentLocales::class)
|
||||
->findBy(
|
||||
[
|
||||
'userId' => $userId
|
||||
]) as $torrentLocales)
|
||||
{
|
||||
$torrentLocales->setApproved(
|
||||
$value
|
||||
);
|
||||
|
||||
$this->entityManagerInterface->persist($torrentLocales);
|
||||
$this->entityManagerInterface->flush();
|
||||
}
|
||||
}
|
||||
|
||||
// Torrent sensitive
|
||||
public function getTorrentSensitive(int $id): ?TorrentSensitive
|
||||
{
|
||||
|
|
@ -424,6 +466,27 @@ class TorrentService
|
|||
return $torrentSensitive;
|
||||
}
|
||||
|
||||
public function setTorrentSensitivesApprovedByUserId(
|
||||
int $userId,
|
||||
bool $value
|
||||
): void
|
||||
{
|
||||
foreach ($this->entityManagerInterface
|
||||
->getRepository(TorrentSensitive::class)
|
||||
->findBy(
|
||||
[
|
||||
'userId' => $userId
|
||||
]) as $torrentSensitive)
|
||||
{
|
||||
$torrentSensitive->setApproved(
|
||||
$value
|
||||
);
|
||||
|
||||
$this->entityManagerInterface->persist($torrentSensitive);
|
||||
$this->entityManagerInterface->flush();
|
||||
}
|
||||
}
|
||||
|
||||
// Torrent star
|
||||
public function findTorrentStar(
|
||||
int $torrentId,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue