-
Notifications
You must be signed in to change notification settings - Fork 126
Expand file tree
/
Copy pathTopic.php
More file actions
55 lines (44 loc) · 1.04 KB
/
Copy pathTopic.php
File metadata and controls
55 lines (44 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
namespace Craue\FormFlowBundle\Tests\IntegrationTestBundle\Entity;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @author Christian Raue <christian.raue@gmail.com>
* @copyright 2011-2015 Christian Raue
* @license http://opensource.org/licenses/mit-license.php MIT License
*/
class Topic {
/**
* @var string
* @Assert\NotBlank(groups={"flow_createTopic_step1"})
*/
public $title;
/**
* @var string
*/
public $description;
/**
* @var string
* @Assert\Choice(callback="getValidCategories", groups={"flow_createTopic_step1"})
* @Assert\NotBlank(groups={"flow_createTopic_step1"})
*/
public $category;
/**
* @var string
*/
public $comment;
/**
* @var string
* @Assert\NotBlank(groups={"flow_createTopic_step3"})
*/
public $details;
public function isBugReport() {
return $this->category === 'BUG_REPORT';
}
public static function getValidCategories() {
return array(
'DISCUSSION',
'BUG_REPORT',
'SUPPORT_REQUEST',
);
}
}