mirror of
https://github.com/YGGverse/YGGtracker.git
synced 2026-04-01 01:25:39 +00:00
implement locales moderation methods
This commit is contained in:
parent
fafca13b32
commit
d34ff8ecc6
3 changed files with 192 additions and 14 deletions
|
|
@ -158,6 +158,36 @@ class TorrentService
|
|||
->findTorrentSensitive($torrentId);
|
||||
}
|
||||
|
||||
// Update
|
||||
public function toggleTorrentLocalesApproved(
|
||||
int $id
|
||||
): ?TorrentLocales
|
||||
{
|
||||
$torrentLocales = $this->getTorrentLocales($id);
|
||||
|
||||
$torrentLocales->setApproved(
|
||||
!$torrentLocales->isApproved() // toggle current value
|
||||
);
|
||||
|
||||
$this->entityManagerInterface->persist($torrentLocales);
|
||||
$this->entityManagerInterface->flush();
|
||||
|
||||
return $torrentLocales;
|
||||
}
|
||||
|
||||
// Delete
|
||||
public function deleteTorrentLocales(
|
||||
int $id
|
||||
): ?TorrentLocales
|
||||
{
|
||||
$torrentLocales = $this->getTorrentLocales($id);
|
||||
|
||||
$this->entityManagerInterface->remove($torrentLocales);
|
||||
$this->entityManagerInterface->flush();
|
||||
|
||||
return $torrentLocales;
|
||||
}
|
||||
|
||||
// Setters
|
||||
public function add(
|
||||
string $filepath,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue