Answer::setQuestion()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: device
5
 * Date: 23.02.16
6
 * Time: 10:00
7
 */
8
9
namespace AppBundle\Entity;
10
11
use Doctrine\Common\Collections\ArrayCollection;
12
use Doctrine\ORM\Mapping as ORM;
13
use Symfony\Component\Validator\Constraints as Assert;
14
15
/**
16
 * Answer
17
 *
18
 * @ORM\Table(name="answer")
19
 * @ORM\Entity(repositoryClass="AppBundle\Repository\AnswerRepository")
20
 */
21
class Answer
22
{
23
    /**
24
     * @ORM\Id
25
     * @ORM\GeneratedValue
26
     * @ORM\Column(type="integer")
27
     */
28
    private $id;
29
30
    /**
31
     * @ORM\Column(name="text_answer", type="string")
32
     * @Assert\NotBlank()
33
     */
34
    private $textAnswer;
35
36
    /**
37
     * @ORM\Column(name="correctly", type="boolean")
38
     */
39
    private $correctly;
40
41
42
    /**
43
     * @ORM\ManyToOne(targetEntity="AppBundle\Entity\Question", inversedBy="answers")
44
     */
45
    private $question;
46
47
    /**
48
     * @return mixed
49
     */
50
    public function getQuestion()
51
    {
52
        return $this->question;
53
    }
54
55
    /**
56
     * @param mixed $question
57
     */
58 27
    public function setQuestion(Question $question = null)
59
    {
60 27
        $this->question = $question;
61 27
    }
62
63
    /**
64
     * @return mixed
65
     */
66
67
    /**
68
     * @return mixed
69
     */
70 1
    public function getId()
71
    {
72 1
        return $this->id;
73
    }
74
75
    /**
76
     * @return mixed
77
     */
78 2
    public function getTextAnswer()
79
    {
80 2
        return $this->textAnswer;
81
    }
82
83
    /**
84
     * @param mixed $textAnswer
85
     */
86 27
    public function setTextAnswer($textAnswer)
87
    {
88 27
        $this->textAnswer = $textAnswer;
89 27
    }
90
91
    /**
92
     * @return mixed
93
     */
94 1
    public function getCorrectly()
95
    {
96 1
        return $this->correctly;
97
    }
98
99
    /**
100
     * @param mixed $correctly
101
     */
102 27
    public function setCorrectly($correctly)
103
    {
104 27
        $this->correctly = $correctly;
105
    }
106
}