Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
B
Backend Server
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
SpinShare
Backend Server
Commits
56c3945f
Commit
56c3945f
authored
Jul 20, 2020
by
SpinShare
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove notifications if song was removed
parent
3cf24746
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
0 deletions
+19
-0
public/uploads/thumbnail/spinshare_5ea59dc7d66e5.jpg
public/uploads/thumbnail/spinshare_5ea59dc7d66e5.jpg
+0
-0
src/Controller/Moderation/ModactionsController.php
src/Controller/Moderation/ModactionsController.php
+13
-0
src/Controller/SongController.php
src/Controller/SongController.php
+6
-0
No files found.
public/uploads/thumbnail/spinshare_5ea59dc7d66e5.jpg
deleted
100644 → 0
View file @
3cf24746
10.9 KB
src/Controller/Moderation/ModactionsController.php
View file @
56c3945f
...
...
@@ -17,6 +17,7 @@ use App\Entity\Song;
use
App\Entity\User
;
use
App\Entity\SongReport
;
use
App\Entity\UserReport
;
use
App\Entity\UserNotification
;
use
App\Entity\Promo
;
class
ModactionsController
extends
AbstractController
...
...
@@ -70,6 +71,12 @@ class ModactionsController extends AbstractController
}
$em
->
remove
(
$songToRemove
);
$notifications
=
$em
->
getRepository
(
UserNotification
::
class
)
->
findBy
(
array
(
'connectedSong'
=>
$songToRemove
));
foreach
(
$notifications
as
$notification
)
{
$em
->
remove
(
$notification
);
}
$em
->
flush
();
return
$this
->
redirectToRoute
(
'user.detail'
,
array
(
'userId'
=>
$uploader
->
getId
()));
...
...
@@ -136,6 +143,12 @@ class ModactionsController extends AbstractController
}
catch
(
\Exception
$e
)
{
}
$em
->
remove
(
$reportSong
);
$notifications
=
$em
->
getRepository
(
UserNotification
::
class
)
->
findBy
(
array
(
'connectedSong'
=>
$reportSong
));
foreach
(
$notifications
as
$notification
)
{
$em
->
remove
(
$notification
);
}
$em
->
flush
();
return
$this
->
redirectToRoute
(
'moderation.reports.song'
,
array
(
'reportId'
=>
$reportId
));
...
...
src/Controller/SongController.php
View file @
56c3945f
...
...
@@ -440,6 +440,12 @@ class SongController extends AbstractController
// remove the entity
$em
->
remove
(
$result
);
$notifications
=
$em
->
getRepository
(
UserNotification
::
class
)
->
findBy
(
array
(
'connectedSong'
=>
$songId
));
foreach
(
$notifications
as
$notification
)
{
$em
->
remove
(
$notification
);
}
$em
->
flush
();
// reditect
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment