Completed
Push — master ( 1e7ae1...1641c1 )
by Axel
04:29
created

Vote::setOption()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 5
ccs 0
cts 3
cp 0
crap 2
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace App\Model\Project;
4
5
use Symfony\Component\Security\Core\User\UserInterface;
6
7
abstract class Vote
8
{
9
    /** @var Poll **/
10
    protected $poll;
11
    /** @var UserInterface **/
12
    protected $user;
13
    /** @var string **/
14
    protected $option;
15
    /** @var bool **/
16
    protected $isPositive;
17
    /** @var \DateTime **/
18
    protected $createdAt;
19
    
20
    const OPTION_POSITIVE_TECH = 'positive.tech';
21
    const OPTION_POSITIVE_PURPOSE = 'positive.purpose';
22
    
23
    const OPTION_NEGATIVE_TECH = 'negative.tech';
24
    const OPTION_NEGATIVE_PURPOSE = 'negative.purpose';
25
    const OPTION_NEGATIVE_INFOS = 'negative.infos';
26
    
27
    public function setPoll(Poll $poll): Vote
28
    {
29
        $this->poll = $poll;
30
        
31
        return $this;
32
    }
33
    
34
    public function getPoll(): Poll
35
    {
36
        return $this->poll;
37
    }
38
    
39
    public function setUser(UserInterface $user): Vote
40
    {
41
        $this->user = $user;
42
        
43
        return $this;
44
    }
45
    
46
    public function getUser(): UserInterface
47
    {
48
        return $this->user;
49
    }
50
    
51
    public function setOption(string $option): Vote
52
    {
53
        $this->option = $option;
54
        
55
        return $this;
56
    }
57
    
58
    public function getOption(): string
59
    {
60
        return $this->option;
61
    }
62
    
63
    public function setIsPositive(bool $isPositive): Vote
64
    {
65
        $this->isPositive = $isPositive;
66
        
67
        return $this;
68
    }
69
    
70
    public function getIsPositive(): bool
71
    {
72
        return $this->isPositive;
73
    }
74
    
75
    public function setCreatedAt(\DateTime $createdAt): Vote
76
    {
77
        $this->createdAt = $createdAt;
78
        
79
        return $this;
80
    }
81
    
82
    public function getCreatedAt(): \DateTime
83
    {
84
        return $this->createdAt;
85
    }
86
}