mirror of
https://github.com/YGGverse/YGGtracker.git
synced 2026-04-01 01:25:39 +00:00
add category edition events support #26
This commit is contained in:
parent
2e9b119733
commit
31aad63399
28 changed files with 1514 additions and 37 deletions
|
|
@ -51,6 +51,11 @@ class ActivityService
|
|||
Activity::EVENT_TORRENT_LOCALES_APPROVE_ADD,
|
||||
Activity::EVENT_TORRENT_LOCALES_APPROVE_DELETE,
|
||||
|
||||
Activity::EVENT_TORRENT_CATEGORIES_ADD,
|
||||
Activity::EVENT_TORRENT_CATEGORIES_DELETE,
|
||||
Activity::EVENT_TORRENT_CATEGORIES_APPROVE_ADD,
|
||||
Activity::EVENT_TORRENT_CATEGORIES_APPROVE_DELETE,
|
||||
|
||||
Activity::EVENT_TORRENT_SENSITIVE_ADD,
|
||||
Activity::EVENT_TORRENT_SENSITIVE_DELETE,
|
||||
Activity::EVENT_TORRENT_SENSITIVE_APPROVE_ADD,
|
||||
|
|
@ -277,6 +282,55 @@ class ActivityService
|
|||
|
||||
break;
|
||||
|
||||
/// Torrent categories
|
||||
case Activity::EVENT_TORRENT_CATEGORIES_ADD:
|
||||
|
||||
$events
|
||||
[
|
||||
$this->translatorInterface->trans('Torrent categories')
|
||||
]
|
||||
[
|
||||
$this->translatorInterface->trans('Added')
|
||||
] = $code;
|
||||
|
||||
break;
|
||||
|
||||
case Activity::EVENT_TORRENT_CATEGORIES_DELETE:
|
||||
|
||||
$events
|
||||
[
|
||||
$this->translatorInterface->trans('Torrent categories')
|
||||
]
|
||||
[
|
||||
$this->translatorInterface->trans('Deleted')
|
||||
] = $code;
|
||||
|
||||
break;
|
||||
|
||||
case Activity::EVENT_TORRENT_CATEGORIES_APPROVE_ADD:
|
||||
|
||||
$events
|
||||
[
|
||||
$this->translatorInterface->trans('Torrent categories')
|
||||
]
|
||||
[
|
||||
$this->translatorInterface->trans('Approved')
|
||||
] = $code;
|
||||
|
||||
break;
|
||||
|
||||
case Activity::EVENT_TORRENT_CATEGORIES_APPROVE_DELETE:
|
||||
|
||||
$events
|
||||
[
|
||||
$this->translatorInterface->trans('Torrent categories')
|
||||
]
|
||||
[
|
||||
$this->translatorInterface->trans('Disapproved')
|
||||
] = $code;
|
||||
|
||||
break;
|
||||
|
||||
/// Torrent sensitive
|
||||
case Activity::EVENT_TORRENT_SENSITIVE_ADD:
|
||||
|
||||
|
|
@ -1303,6 +1357,155 @@ class ActivityService
|
|||
return $activity;
|
||||
}
|
||||
|
||||
/// Torrent categories
|
||||
public function addEventTorrentCategoriesAdd(
|
||||
int $userId,
|
||||
int $torrentId,
|
||||
int $added,
|
||||
int $torrentCategoriesId,
|
||||
): ?Activity
|
||||
{
|
||||
$activity = new Activity();
|
||||
|
||||
$activity->setEvent(
|
||||
Activity::EVENT_TORRENT_CATEGORIES_ADD
|
||||
);
|
||||
|
||||
$activity->setUserId(
|
||||
$userId
|
||||
);
|
||||
|
||||
$activity->setTorrentId(
|
||||
$torrentId
|
||||
);
|
||||
|
||||
$activity->setAdded(
|
||||
$added
|
||||
);
|
||||
|
||||
$activity->setData(
|
||||
[
|
||||
'torrentCategoriesId' => $torrentCategoriesId
|
||||
]
|
||||
);
|
||||
|
||||
$this->entityManagerInterface->persist($activity);
|
||||
$this->entityManagerInterface->flush();
|
||||
|
||||
return $activity;
|
||||
}
|
||||
|
||||
public function addEventTorrentCategoriesDelete(
|
||||
int $userId,
|
||||
int $torrentId,
|
||||
int $added,
|
||||
int $torrentCategoriesId,
|
||||
): ?Activity
|
||||
{
|
||||
$activity = new Activity();
|
||||
|
||||
$activity->setEvent(
|
||||
Activity::EVENT_TORRENT_CATEGORIES_DELETE
|
||||
);
|
||||
|
||||
$activity->setUserId(
|
||||
$userId
|
||||
);
|
||||
|
||||
$activity->setTorrentId(
|
||||
$torrentId
|
||||
);
|
||||
|
||||
$activity->setAdded(
|
||||
$added
|
||||
);
|
||||
|
||||
$activity->setData(
|
||||
[
|
||||
'torrentCategoriesId' => $torrentCategoriesId
|
||||
]
|
||||
);
|
||||
|
||||
$this->entityManagerInterface->persist($activity);
|
||||
$this->entityManagerInterface->flush();
|
||||
|
||||
return $activity;
|
||||
}
|
||||
|
||||
public function addEventTorrentCategoriesApproveAdd(
|
||||
int $userId,
|
||||
int $torrentId,
|
||||
int $added,
|
||||
int $torrentCategoriesId,
|
||||
): ?Activity
|
||||
{
|
||||
$activity = new Activity();
|
||||
|
||||
$activity->setEvent(
|
||||
Activity::EVENT_TORRENT_CATEGORIES_APPROVE_ADD
|
||||
);
|
||||
|
||||
$activity->setUserId(
|
||||
$userId
|
||||
);
|
||||
|
||||
$activity->setTorrentId(
|
||||
$torrentId
|
||||
);
|
||||
|
||||
$activity->setAdded(
|
||||
$added
|
||||
);
|
||||
|
||||
$activity->setData(
|
||||
[
|
||||
'torrentCategoriesId' => $torrentCategoriesId
|
||||
]
|
||||
);
|
||||
|
||||
$this->entityManagerInterface->persist($activity);
|
||||
$this->entityManagerInterface->flush();
|
||||
|
||||
return $activity;
|
||||
}
|
||||
|
||||
public function addEventTorrentCategoriesApproveDelete(
|
||||
int $userId,
|
||||
int $torrentId,
|
||||
int $added,
|
||||
int $torrentCategoriesId,
|
||||
): ?Activity
|
||||
{
|
||||
$activity = new Activity();
|
||||
|
||||
$activity->setEvent(
|
||||
Activity::EVENT_TORRENT_CATEGORIES_APPROVE_DELETE
|
||||
);
|
||||
|
||||
$activity->setUserId(
|
||||
$userId
|
||||
);
|
||||
|
||||
$activity->setTorrentId(
|
||||
$torrentId
|
||||
);
|
||||
|
||||
$activity->setAdded(
|
||||
$added
|
||||
);
|
||||
|
||||
$activity->setData(
|
||||
[
|
||||
'torrentCategoriesId' => $torrentCategoriesId
|
||||
]
|
||||
);
|
||||
|
||||
$this->entityManagerInterface->persist($activity);
|
||||
$this->entityManagerInterface->flush();
|
||||
|
||||
return $activity;
|
||||
}
|
||||
|
||||
/// Torrent sensitive
|
||||
public function addEventTorrentSensitiveAdd(
|
||||
int $userId,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue