|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/* |
|
4
|
|
|
* This file is part of the CCDNForum ForumBundle |
|
5
|
|
|
* |
|
6
|
|
|
* (c) CCDN (c) CodeConsortium <http://www.codeconsortium.com/> |
|
7
|
|
|
* |
|
8
|
|
|
* Available on github <http://www.github.com/codeconsortium/> |
|
9
|
|
|
* |
|
10
|
|
|
* For the full copyright and license information, please view the LICENSE |
|
11
|
|
|
* file that was distributed with this source code. |
|
12
|
|
|
*/ |
|
13
|
|
|
|
|
14
|
|
|
namespace CCDNForum\ForumBundle\Controller; |
|
15
|
|
|
|
|
16
|
|
|
use CCDNForum\ForumBundle\Entity\Forum; |
|
17
|
|
|
use CCDNForum\ForumBundle\Entity\Board; |
|
18
|
|
|
use CCDNForum\ForumBundle\Entity\Topic; |
|
19
|
|
|
|
|
20
|
|
|
/** |
|
21
|
|
|
* |
|
22
|
|
|
* @category CCDNForum |
|
23
|
|
|
* @package ForumBundle |
|
24
|
|
|
* |
|
25
|
|
|
* @author Reece Fowell <[email protected]> |
|
26
|
|
|
* @license http://opensource.org/licenses/MIT MIT |
|
27
|
|
|
* @version Release: 2.0 |
|
28
|
|
|
* @link https://github.com/codeconsortium/CCDNForumForumBundle |
|
29
|
|
|
* |
|
30
|
|
|
*/ |
|
31
|
|
|
class UserTopicBaseController extends BaseController |
|
32
|
|
|
{ |
|
33
|
|
|
/** |
|
34
|
|
|
* |
|
35
|
|
|
* @access protected |
|
36
|
|
|
* @param \CCDNForum\ForumBundle\Entity\Forum $forum |
|
37
|
|
|
* @param \CCDNForum\ForumBundle\Entity\Board $board |
|
38
|
|
|
* @return \CCDNForum\ForumBundle\Form\Handler\TopicCreateFormHandler |
|
39
|
|
|
*/ |
|
40
|
|
|
protected function getFormHandlerToCreateTopic(Forum $forum, Board $board) |
|
41
|
|
|
{ |
|
42
|
|
|
$formHandler = $this->container->get('ccdn_forum_forum.form.handler.topic_create'); |
|
43
|
|
|
|
|
44
|
|
|
$formHandler->setForum($forum); |
|
45
|
|
|
$formHandler->setBoard($board); |
|
46
|
|
|
$formHandler->setUser($this->getUser()); |
|
47
|
|
|
$formHandler->setRequest($this->getRequest()); |
|
48
|
|
|
|
|
49
|
|
|
return $formHandler; |
|
50
|
|
|
} |
|
51
|
|
|
|
|
52
|
|
|
/** |
|
53
|
|
|
* |
|
54
|
|
|
* @access protected |
|
55
|
|
|
* @param \CCDNForum\ForumBundle\Entity\Topic $topic |
|
56
|
|
|
* @return \CCDNForum\ForumBundle\Form\Handler\TopicCreateFormHandler |
|
57
|
|
|
*/ |
|
58
|
|
|
protected function getFormHandlerToReplyToTopic(Topic $topic) |
|
59
|
|
|
{ |
|
60
|
|
|
$formHandler = $this->container->get('ccdn_forum_forum.form.handler.post_create'); |
|
61
|
|
|
|
|
62
|
|
|
$formHandler->setTopic($topic); |
|
63
|
|
|
$formHandler->setUser($this->getUser()); |
|
64
|
|
|
$formHandler->setRequest($this->getRequest()); |
|
65
|
|
|
|
|
66
|
|
|
return $formHandler; |
|
67
|
|
|
} |
|
68
|
|
|
} |
|
69
|
|
|
|