Completed
Pull Request — master (#30)
by
unknown
03:43
created

SurveyType::getId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
namespace AppBundle\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
6
use Knp\DoctrineBehaviors\Model as ORMBehaviors;
7
use Doctrine\Common\Collections\ArrayCollection;
8
use Symfony\Component\Validator\Constraints as Assert;
9
10
/**
11
 * SurveyType.
12
 *
13
 * @ORM\Entity(repositoryClass="AppBundle\Repository\SurveyTypeRepository")
14
 */
15
class SurveyType
16
{
17
    use ORMBehaviors\Timestampable\Timestampable;
18
19
    /**
20
     * @var int
21
     *
22
     * @ORM\Column(type="integer")
23
     * @ORM\Id
24
     * @ORM\GeneratedValue(strategy="AUTO")
25
     */
26
    private $id;
27
28
    /**
29
     * @var string
30
     * @Assert\NotBlank()
31
     * @Assert\Type("string")
32
     * @Assert\Length(
33
     *      min = 2,
34
     *      max = 190
35
     * )
36
     * @ORM\Column(type="string", length=190, unique=true)
37
     */
38
    private $name;
39
40
    /**
41
     * @var ArrayCollection[Survey]
42
     * @ORM\OneToMany(targetEntity="Survey", mappedBy="type")
43
     */
44
    private $surveys;
45
46
    /**
47
     * @var ArrayCollection[SurveyQuestion]
48
     * @ORM\OneToMany(targetEntity="SurveyQuestion", mappedBy="surveyType")
49
     */
50
    private $questions;
51
52
    public function __construct()
53
    {
54
        $this->surveys = new ArrayCollection();
55
        $this->questions = new ArrayCollection();
56
    }
57
58
    /**
59
     * Get id.
60
     *
61
     * @return int
62
     */
63
    public function getId()
64
    {
65
        return $this->id;
66
    }
67
68
    /**
69
     * Set name.
70
     *
71
     * @param string $name
72
     *
73
     * @return SurveyType
74
     */
75
    public function setName($name)
76
    {
77
        $this->name = $name;
78
79
        return $this;
80
    }
81
82
    /**
83
     * Get name.
84
     *
85
     * @return string
86
     */
87
    public function getName()
88
    {
89
        return $this->name;
90
    }
91
92
    /**
93
     * Get Surveys.
94
     *
95
     * @return ArrayCollection
96
     */
97
    public function getSurveys()
98
    {
99
        return $this->surveys;
100
    }
101
102
    /**
103
     * Get Questions.
104
     *
105
     * @return ArrayCollection
106
     */
107
    public function getQuestions()
108
    {
109
        return $this->questions;
110
    }
111
}
112