Pontlyvalent::setTarget()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace KI\UserBundle\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
6
use JMS\Serializer\Annotation as JMS;
7
use Symfony\Component\Validator\Constraints as Assert;
8
9
/**
10
 * @ORM\Entity(repositoryClass="KI\UserBundle\Repository\PontlyvalentRepository")
11
 * @JMS\ExclusionPolicy("all")
12
 */
13
class Pontlyvalent
14
{
15
    /**
16
     * @ORM\Id
17
     * @ORM\Column(name="id", type="integer")
18
     * @ORM\GeneratedValue(strategy="AUTO")
19
     */
20
    protected $id;
21
22
    /**
23
     * Texte de commentaire
24
     * @ORM\Column(name="text", type="text", nullable=false)
25
     * @JMS\Expose
26
     * @Assert\Type("string")
27
     * @Assert\NotBlank()
28
     */
29
    protected $text;
30
31
    /**
32
     * Date
33
     * @ORM\Column(name="date", type="integer", nullable=true)
34
     * @JMS\Expose
35
     * @Assert\Type("integer")
36
     */
37
    protected $date;
38
39
    /**
40
     * @ORM\ManyToOne(targetEntity="KI\UserBundle\Entity\User")
41
     * @ORM\JoinColumn(nullable=false)
42
     * @JMS\Expose
43
     */
44
    protected $target;
45
46
    /**
47
     * @ORM\ManyToOne(targetEntity="KI\UserBundle\Entity\User")
48
     * @ORM\JoinColumn(nullable=false)
49
     * @JMS\Expose
50
     */
51
    protected $author;
52
53
    public function __construct()
54
    {
55
        $this->date = time();
56
    }
57
58
    /**
59
     * Get id
60
     *
61
     * @return integer
62
     */
63
    public function getId()
64
    {
65
        return $this->id;
66
    }
67
68
    /**
69
     * Set date
70
     *
71
     * @param integer $date
72
     * @return Pontlyvalent
73
     */
74
    public function setDate($date)
75
    {
76
        $this->date = $date;
77
78
        return $this;
79
    }
80
81
    /**
82
     * Get date
83
     *
84
     * @return integer
85
     */
86
    public function getDate()
87
    {
88
        return $this->date;
89
    }
90
91
    /**
92
     * Set text
93
     *
94
     * @param string $text
95
     * @return Pontlyvalent
96
     */
97
    public function setText($text)
98
    {
99
        $this->text = $text;
100
101
        return $this;
102
    }
103
104
    /**
105
     * Get text
106
     *
107
     * @return string
108
     */
109
    public function getText()
110
    {
111
        return $this->text;
112
    }
113
114
    /**
115
     * Set target
116
     *
117
     * @param User $target
118
     * @return Pontlyvalent
119
     */
120
    public function setTarget($target)
121
    {
122
        $this->target = $target;
123
124
        return $this;
125
    }
126
127
    /**
128
     * Get target
129
     *
130
     * @return User
131
     */
132
    public function getTarget()
133
    {
134
        return $this->target;
135
    }
136
137
    /**
138
     * Set author
139
     *
140
     * @param User $author
141
     * @return Pontlyvalent
142
     */
143
    public function setAuthor(User $author)
144
    {
145
        $this->author = $author;
146
147
        return $this;
148
    }
149
150
    /**
151
     * Get author
152
     *
153
     * @return User
154
     */
155
    public function getAuthor()
156
    {
157
        return $this->author;
158
    }
159
}
160