Template::removeEvent()   A
last analyzed

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\CampaignBundle\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
6
use Starkerxp\StructureBundle\Entity\AbstractUser;
7
8
/**
9
 * Template.
10
 *
11
 * @ORM\Table(name="template", indexes={
12
 *  @ORM\Index(columns={"type"}),
13
 *  @ORM\Index(columns={"created_at"}),
14
 *  @ORM\Index(columns={"updated_at"})
15
 * })
16
 * @ORM\Entity(repositoryClass="Starkerxp\CampaignBundle\Repository\TemplateRepository")
17
 */
18
class Template extends AbstractUser
19
{
20
21
    /**
22
     * @var string
23
     *
24
     * @ORM\Column(name="name", type="string", length=255)
25
     */
26
    protected $name;
27
28
    /**
29
     * @var string
30
     *
31
     * @ORM\Column(name="type", type="string", length=255)
32
     */
33
    protected $type;
34
35
    /**
36
     * @var string
37
     *
38
     * @ORM\Column(name="object", type="string", length=255)
39
     */
40
    protected $object;
41
42
    /**
43
     * @var string
44
     *
45
     * @ORM\Column(name="message", type="text")
46
     */
47
    protected $message;
48
49
    /**
50
     * @ORM\OneToMany(
51
     *      targetEntity="Event",
52
     *      mappedBy="template"
53
     * )
54
     */
55
    protected $events;
56
57
    /**
58
     * Constructor
59
     */
60
    public function __construct()
61
    {
62
        $this->events = new \Doctrine\Common\Collections\ArrayCollection();
63
    }
64
65
    /**
66
     * Get nom.
67
     *
68
     * @return string
69
     */
70
    public function getName()
71
    {
72
        return $this->name;
73
    }
74
75
    /**
76
     * Set nom.
77
     *
78
     * @param string $name
79
     *
80
     */
81
    public function setName($name)
82
    {
83
        $this->name = $name;
84
    }
85
86
    /**
87
     * Get type.
88
     *
89
     * @return string
90
     */
91
    public function getType()
92
    {
93
        return $this->type;
94
    }
95
96
    /**
97
     * Set type.
98
     *
99
     * @param string $type
100
     *
101
     */
102
    public function setType($type)
103
    {
104
        $this->type = $type;
105
    }
106
107
    /**
108
     * Get object.
109
     *
110
     * @return string
111
     */
112
    public function getObject()
113
    {
114
        return $this->object;
115
    }
116
117
    /**
118
     * Set object.
119
     *
120
     * @param string $object
121
     *
122
     */
123
    public function setObject($object)
124
    {
125
        $this->object = $object;
126
    }
127
128
    /**
129
     * Get message.
130
     *
131
     * @return string
132
     */
133
    public function getMessage()
134
    {
135
        return $this->message;
136
    }
137
138
    /**
139
     * Set message.
140
     *
141
     * @param string $message
142
     *
143
     */
144
    public function setMessage($message)
145
    {
146
        $this->message = $message;
147
    }
148
149
    /**
150
     * Add event
151
     *
152
     * @param \Starkerxp\CampaignBundle\Entity\Event $event
153
     *
154
     * @return Template
155
     */
156
    public function addEvent(\Starkerxp\CampaignBundle\Entity\Event $event)
157
    {
158
        $this->events[] = $event;
159
160
        return $this;
161
    }
162
163
    /**
164
     * Remove event
165
     *
166
     * @param \Starkerxp\CampaignBundle\Entity\Event $event
167
     */
168
    public function removeEvent(\Starkerxp\CampaignBundle\Entity\Event $event)
169
    {
170
        $this->events->removeElement($event);
171
    }
172
173
    /**
174
     * Get events
175
     *
176
     * @return \Doctrine\Common\Collections\Collection
177
     */
178
    public function getEvents()
179
    {
180
        return $this->events;
181
    }
182
}
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...
183