Passed
Push — 1.11.x ( ef117b...855efb )
by Julito
11:43
created

MeetingActivity::setName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 2
c 1
b 0
f 1
nc 1
nop 1
dl 0
loc 5
rs 10
1
<?php
2
3
/* For licensing terms, see /license.txt */
4
5
namespace Chamilo\PluginBundle\Zoom;
6
7
use DateTime;
8
use Doctrine\ORM\Mapping as ORM;
9
10
/**
11
 * Class Meeting.
12
 *
13
 * @ORM\Entity()
14
 * @ORM\Table(name="plugin_zoom_meeting_activity")
15
 * @ORM\HasLifecycleCallbacks
16
 */
17
class MeetingActivity
18
{
19
    /**
20
     * @var int
21
     * @ORM\Column(type="integer")
22
     * @ORM\Id
23
     * @ORM\GeneratedValue()
24
     */
25
    protected $id;
26
27
    /**
28
     * @var Meeting
29
     * @ORM\ManyToOne(targetEntity="Meeting", inversedBy="activities")
30
     * @ORM\JoinColumn(name="meeting_id")
31
     */
32
    protected $meeting;
33
34
    /**
35
     * @var Meeting
36
     * @ORM\ManyToOne(targetEntity="Chamilo\UserBundle\Entity\User")
37
     * @ORM\JoinColumn(name="user_id", referencedColumnName="id")
38
     */
39
    protected $user;
40
41
    /**
42
     * @var string
43
     * @ORM\Column(type="string", name="name", length=255, nullable=false)
44
     */
45
    protected $name;
46
47
    /**
48
     * @var string
49
     * @ORM\Column(type="string", name="type", length=255, nullable=false)
50
     */
51
    protected $type;
52
53
    /**
54
     * @var string
55
     * @ORM\Column(type="text", name="event", nullable=true)
56
     */
57
    protected $event;
58
59
    /**
60
     * @var \DateTime
61
     *
62
     * @ORM\Column(name="created_at", type="datetime", nullable=false)
63
     */
64
    protected $createdAt;
65
66
    public function __construct()
67
    {
68
        $this->createdAt = new \DateTime();
69
    }
70
71
    /**
72
     * @return string
73
     */
74
    public function __toString()
75
    {
76
        return sprintf('Activity %d', $this->id);
77
    }
78
79
    /**
80
     * @return int
81
     */
82
    public function getId()
83
    {
84
        return $this->id;
85
    }
86
87
    /**
88
     * @return Meeting
89
     */
90
    public function getMeeting()
91
    {
92
        return $this->meeting;
93
    }
94
95
    /**
96
     * @param Meeting $meeting
97
     *
98
     * @return MeetingActivity
99
     */
100
    public function setMeeting($meeting)
101
    {
102
        $this->meeting = $meeting;
103
104
        return $this;
105
    }
106
107
    /**
108
     * @return string
109
     */
110
    public function getName()
111
    {
112
        return $this->name;
113
    }
114
115
    /**
116
     * @param string $name
117
     *
118
     * @return MeetingActivity
119
     */
120
    public function setName($name)
121
    {
122
        $this->name = $name;
123
124
        return $this;
125
    }
126
127
    /**
128
     * @return string
129
     */
130
    public function getType()
131
    {
132
        return $this->type;
133
    }
134
135
    /**
136
     * @param string $type
137
     *
138
     * @return MeetingActivity
139
     */
140
    public function setType($type)
141
    {
142
        $this->type = $type;
143
144
        return $this;
145
    }
146
147
    /**
148
     * @return DateTime
149
     */
150
    public function getCreatedAt()
151
    {
152
        return $this->createdAt;
153
    }
154
155
    /**
156
     * @return string
157
     */
158
    public function getEvent()
159
    {
160
        return $this->event;
161
    }
162
163
    /**
164
     * @return Meeting
165
     */
166
    public function getUser()
167
    {
168
        return $this->user;
169
    }
170
171
    /**
172
     * @param Meeting $user
173
     *
174
     * @return MeetingActivity
175
     */
176
    public function setUser($user)
177
    {
178
        $this->user = $user;
179
180
        return $this;
181
    }
182
183
    public function getEventDecoded()
184
    {
185
        if (!empty($this->event)) {
186
            return json_decode($this->event);
187
        }
188
189
        return '';
190
    }
191
192
    /**
193
     * @param string $event
194
     *
195
     * @return MeetingActivity
196
     */
197
    public function setEvent($event)
198
    {
199
        $this->event = $event;
200
201
        return $this;
202
    }
203
}
204