1 | <?php |
||
30 | class DeleteThreadController |
||
31 | { |
||
32 | /** |
||
33 | * A templating engine |
||
34 | * |
||
35 | * @var EngineInterface |
||
36 | */ |
||
37 | private $templating; |
||
38 | |||
39 | /** |
||
40 | * A delete thread manager instance. |
||
41 | * |
||
42 | * @var DeleteThreadManagerSecureInterface |
||
43 | */ |
||
44 | private $deleteThreadManager; |
||
45 | |||
46 | /** |
||
47 | * A thread provider instance. |
||
48 | * |
||
49 | * @var ThreadProviderInterface |
||
50 | */ |
||
51 | private $threadProvider; |
||
52 | |||
53 | /** |
||
54 | * A flash message provider. |
||
55 | * |
||
56 | * @var flashMessageProviderInterface |
||
57 | */ |
||
58 | private $flashMessageProvider; |
||
59 | |||
60 | /** |
||
61 | * A routing instance. |
||
62 | * |
||
63 | * @var RouterInterface |
||
64 | */ |
||
65 | private $router; |
||
66 | |||
67 | /** |
||
68 | * A participant provider. |
||
69 | * |
||
70 | * @var ParticipantProviderInterface |
||
71 | */ |
||
72 | private $participantProvider; |
||
73 | |||
74 | |||
75 | /** |
||
76 | * Constructor. |
||
77 | * |
||
78 | * @param EngineInterface $templating |
||
79 | * @param DeleteThreadManagerSecureInterface $deleteThreadManager |
||
80 | * @param ThreadProviderInterface $threadProvider |
||
81 | * @param FlashMessageProviderInterface $flashMessageProvider |
||
82 | * @param RouterInterface $router |
||
83 | * @param ParticipantProviderInterface $participantProvider |
||
84 | */ |
||
85 | public function __construct( |
||
100 | |||
101 | /** |
||
102 | * Deletes a thread. |
||
103 | * |
||
104 | * Deletes a thread and returns the user to the inbox with a success or error flash message. |
||
105 | * |
||
106 | * @param integer $threadId The unique id of the thread |
||
107 | * |
||
108 | * @return Response |
||
109 | */ |
||
110 | public function deleteAction($threadId) |
||
125 | |||
126 | /** |
||
127 | * Deletes the thread and adds a flash. |
||
128 | * |
||
129 | * @param ParticipantInterface $loggedInUser |
||
130 | * @param ThreadInterface $thread |
||
131 | */ |
||
132 | protected function doThreadDelete(ParticipantInterface $loggedInUser, ThreadInterface $thread) |
||
160 | |||
161 | /** |
||
162 | * Adds an error flash. |
||
163 | */ |
||
164 | protected function doThreadNotFound() |
||
173 | } |
||
174 |