Completed
Push — master ( 26547b...4331e3 )
by Guillaume
03:13
created

Campagne::removeCible()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace Starkerxp\CampagneBundle\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
6
use Starkerxp\StructureBundle\Entity\UtilisateurEntity;
7
8
/**
9
 * Campagne.
10
 *
11
 * @ORM\Table(name="campagne", indexes={
12
 *  @ORM\Index(columns={"name"}),
13
 *  @ORM\Index(columns={"deleted"}),
14
 *  @ORM\Index(columns={"status"})
15
 * })
16
 * @ORM\Entity(repositoryClass="Starkerxp\CampagneBundle\Repository\CampagneRepository")
17
 */
18
class Campagne extends UtilisateurEntity
19
{
20
    const DRAFT = 'draft';
21
    const PENDING = 'pending';
22
    const SENT = 'send';
23
    const CANCEL = 'cancel';
24
    const ERROR = 'error';
25
26
    /**
27
     * @var int
28
     *
29
     * @ORM\Column(name="id", type="integer")
30
     * @ORM\Id
31
     * @ORM\GeneratedValue(strategy="AUTO")
32
     */
33
    protected $id;
34
35
    /**
36
     * @var string
37
     *
38
     * @ORM\Column(name="name", type="string", length=255)
39
     */
40
    protected $name;
41
42
    /**
43
     * @var bool
44
     *
45
     * @ORM\Column(name="deleted", type="boolean", options={"default": false})
46
     */
47
    protected $deleted;
48
49
    /**
50
     * @var string
51
     *
52
     * @ORM\Column(name="status", type="string", length=255)
53
     */
54
    protected $status;
55
56
    /**
57
     * @ORM\OneToMany(
58
     *      targetEntity="Event",
59
     *      mappedBy="campagne"
60
     * )
61
     */
62
    protected $events;
63
64
    /**
65
     * @ORM\OneToMany(
66
     *      targetEntity="CampagneCible",
67
     *      mappedBy="campagne"
68
     * )
69
     */
70
    protected $cibles;
71
72
    /**
73
     * Constructor
74
     */
75
    public function __construct()
76
    {
77
        $this->events = new \Doctrine\Common\Collections\ArrayCollection();
78
        $this->cibles = new \Doctrine\Common\Collections\ArrayCollection();
79
        $this->status = self::DRAFT;
80
        $this->deleted = false;
81
    }
82
83
    /**
84
     * Get id.
85
     *
86
     * @return int
87
     */
88
    public function getId()
89
    {
90
        return $this->id;
91
    }
92
93
    /**
94
     * Get name.
95
     *
96
     * @return string
97
     */
98
    public function getName()
99
    {
100
        return $this->name;
101
    }
102
103
    /**
104
     * Set name.
105
     *
106
     * @param string $name
107
     *
108
     */
109
    public function setName($name)
110
    {
111
        $this->name = $name;
112
113
    }
114
115
    /**
116
     * Get status.
117
     *
118
     * @return string
119
     */
120
    public function getStatus()
121
    {
122
        return $this->status;
123
    }
124
125
    /**
126
     * Set status.
127
     *
128
     * @param string $status
129
     *
130
     */
131
    public function setStatus($status)
132
    {
133
        $this->status = $status;
134
    }
135
136
    /**
137
     * Get deleted.
138
     *
139
     * @return bool
140
     */
141
    public function getDeleted()
142
    {
143
        return $this->deleted;
144
    }
145
146
    /**
147
     * Set deleted.
148
     *
149
     * @param bool $deleted
150
     *
151
     */
152
    public function setDeleted($deleted)
153
    {
154
        $this->deleted = $deleted;
155
    }
156
157
    /**
158
     * Add event
159
     *
160
     * @param \Starkerxp\CampagneBundle\Entity\Event $event
161
     *
162
     * @return Campagne
163
     */
164
    public function addEvent(\Starkerxp\CampagneBundle\Entity\Event $event)
165
    {
166
        $this->events[] = $event;
167
168
        return $this;
169
    }
170
171
    /**
172
     * Remove event
173
     *
174
     * @param \Starkerxp\CampagneBundle\Entity\Event $event
175
     */
176
    public function removeEvent(\Starkerxp\CampagneBundle\Entity\Event $event)
177
    {
178
        $this->events->removeElement($event);
179
    }
180
181
    /**
182
     * Get events
183
     *
184
     * @return \Doctrine\Common\Collections\Collection
185
     */
186
    public function getEvents()
187
    {
188
        return $this->events;
189
    }
190
191
    /**
192
     * Add cible
193
     *
194
     * @param \Starkerxp\CampagneBundle\Entity\CampagneCible $cible
195
     *
196
     * @return Campagne
197
     */
198
    public function addCible(\Starkerxp\CampagneBundle\Entity\CampagneCible $cible)
199
    {
200
        $this->cibles[] = $cible;
201
202
        return $this;
203
    }
204
205
    /**
206
     * Remove cible
207
     *
208
     * @param \Starkerxp\CampagneBundle\Entity\CampagneCible $cible
209
     */
210
    public function removeCible(\Starkerxp\CampagneBundle\Entity\CampagneCible $cible)
211
    {
212
        $this->cibles->removeElement($cible);
213
    }
214
215
    /**
216
     * Get cibles
217
     *
218
     * @return \Doctrine\Common\Collections\Collection
219
     */
220
    public function getCibles()
221
    {
222
        return $this->cibles;
223
    }
224
}
0 ignored issues
show
Coding Style introduced by
As per coding style, files should not end with a newline character.

This check marks files that end in a newline character, i.e. an empy line.

Loading history...
225