1 | <?php |
||
48 | class PostController extends Controller |
||
49 | { |
||
50 | /** |
||
51 | * @return RedirectResponse |
||
52 | */ |
||
53 | public function homeAction() |
||
54 | { |
||
55 | return $this->redirect($this->generateUrl('sonata_news_archive')); |
||
56 | } |
||
57 | |||
58 | /** |
||
59 | * @param Request $request |
||
60 | * |
||
61 | * @return Response |
||
62 | */ |
||
63 | public function renderArchive(array $criteria = [], array $parameters = [], ?Request $request = null) |
||
69 | |||
70 | /** |
||
71 | * @param Request $request |
||
72 | * |
||
73 | * @return Response |
||
74 | */ |
||
75 | public function archiveAction(?Request $request = null) |
||
81 | |||
82 | /** |
||
83 | * @param string $tag |
||
84 | * @param Request $request |
||
85 | * |
||
86 | * @throws NotFoundHttpException |
||
87 | * |
||
88 | * @return Response |
||
89 | */ |
||
90 | public function tagAction($tag, ?Request $request = null) |
||
96 | |||
97 | /** |
||
98 | * @param string $collection |
||
99 | * @param Request $request |
||
100 | * |
||
101 | * @throws NotFoundHttpException |
||
102 | * |
||
103 | * @return Response |
||
104 | */ |
||
105 | public function collectionAction($collection, ?Request $request = null) |
||
111 | |||
112 | /** |
||
113 | * @param string $year |
||
114 | * @param string $month |
||
115 | * @param Request $request |
||
116 | * |
||
117 | * @return Response |
||
118 | */ |
||
119 | public function archiveMonthlyAction($year, $month, ?Request $request = null) |
||
125 | |||
126 | /** |
||
127 | * @param string $year |
||
128 | * @param Request $request |
||
129 | * |
||
130 | * @return Response |
||
131 | */ |
||
132 | public function archiveYearlyAction($year, ?Request $request = null) |
||
138 | |||
139 | /** |
||
140 | * @param string $permalink |
||
141 | * |
||
142 | * @throws NotFoundHttpException |
||
143 | * |
||
144 | * @return Response |
||
145 | */ |
||
146 | public function viewAction($permalink) |
||
152 | |||
153 | /** |
||
154 | * @return SeoPageInterface|null |
||
155 | */ |
||
156 | public function getSeoPage() |
||
164 | |||
165 | /** |
||
166 | * @param int $postId |
||
167 | * |
||
168 | * @return Response |
||
169 | */ |
||
170 | public function commentsAction($postId) |
||
176 | |||
177 | /** |
||
178 | * @param $postId |
||
179 | * @param bool $form |
||
180 | * |
||
181 | * @return Response |
||
182 | */ |
||
183 | public function addCommentFormAction($postId, $form = false) |
||
189 | |||
190 | /** |
||
191 | * @return FormInterface |
||
192 | */ |
||
193 | public function getCommentForm(PostInterface $post) |
||
206 | |||
207 | /** |
||
208 | * @param string $id |
||
209 | * @param Request $request |
||
210 | * |
||
211 | * @throws NotFoundHttpException |
||
212 | * |
||
213 | * @return Response |
||
214 | */ |
||
215 | public function addCommentAction($id, ?Request $request = null) |
||
221 | |||
222 | /** |
||
223 | * @param string $commentId |
||
224 | * @param string $hash |
||
225 | * @param string $status |
||
226 | * |
||
227 | * @throws AccessDeniedException |
||
228 | * |
||
229 | * @return RedirectResponse |
||
230 | */ |
||
231 | public function commentModerationAction($commentId, $hash, $status) |
||
237 | |||
238 | /** |
||
239 | * @return PostManagerInterface |
||
240 | */ |
||
241 | protected function getPostManager() |
||
245 | |||
246 | /** |
||
247 | * @return CommentManagerInterface |
||
248 | */ |
||
249 | protected function getCommentManager() |
||
253 | |||
254 | /** |
||
255 | * @return BlogInterface |
||
256 | */ |
||
257 | protected function getBlog() |
||
261 | |||
262 | /** |
||
263 | * To keep backwards compatibility with older Sonata News code. |
||
264 | * |
||
265 | * @internal |
||
266 | * |
||
267 | * @param Request $request |
||
268 | * |
||
269 | * @return Request |
||
270 | */ |
||
271 | private function resolveRequest(?Request $request = null) |
||
279 | } |
||
280 |
If you suppress an error, we recommend checking for the error condition explicitly: