Passed
Push — 1.11.x ( e435f5...5810d8 )
by Julito
10:35
created

MeetingActivity::setEvent()   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 string
36
     * @ORM\Column(type="string", name="name", length=255, nullable=false)
37
     */
38
    protected $name;
39
40
    /**
41
     * @var string
42
     * @ORM\Column(type="string", name="type", length=255, nullable=false)
43
     */
44
    protected $type;
45
46
    /**
47
     * @var string
48
     * @ORM\Column(type="text", name="event", nullable=true)
49
     */
50
    protected $event;
51
52
    /**
53
     * @var \DateTime
54
     *
55
     * @ORM\Column(name="created_at", type="datetime", nullable=false)
56
     */
57
    protected $createdAt;
58
59
    public function __construct()
60
    {
61
        $this->createdAt = new \DateTime();
62
    }
63
64
    /**
65
     * @return string
66
     */
67
    public function __toString()
68
    {
69
        return sprintf('Activity %d', $this->id);
70
    }
71
72
    /**
73
     * @return int
74
     */
75
    public function getId()
76
    {
77
        return $this->id;
78
    }
79
80
    /**
81
     * @return Meeting
82
     */
83
    public function getMeeting()
84
    {
85
        return $this->meeting;
86
    }
87
88
    /**
89
     * @param Meeting $meeting
90
     *
91
     * @return MeetingActivity
92
     */
93
    public function setMeeting($meeting)
94
    {
95
        $this->meeting = $meeting;
96
97
        return $this;
98
    }
99
100
    /**
101
     * @return string
102
     */
103
    public function getName()
104
    {
105
        return $this->name;
106
    }
107
108
    /**
109
     * @param string $name
110
     *
111
     * @return MeetingActivity
112
     */
113
    public function setName($name)
114
    {
115
        $this->name = $name;
116
117
        return $this;
118
    }
119
120
    /**
121
     * @return string
122
     */
123
    public function getType()
124
    {
125
        return $this->type;
126
    }
127
128
    /**
129
     * @param string $type
130
     *
131
     * @return MeetingActivity
132
     */
133
    public function setType($type)
134
    {
135
        $this->type = $type;
136
137
        return $this;
138
    }
139
140
    /**
141
     * @return DateTime
142
     */
143
    public function getCreatedAt()
144
    {
145
        return $this->createdAt;
146
    }
147
148
    /**
149
     * @return string
150
     */
151
    public function getEvent()
152
    {
153
        return $this->event;
154
    }
155
156
    public function getEventDecoded()
157
    {
158
        if (!empty($this->event)) {
159
            return json_decode($this->event);
160
        }
161
162
        return '';
163
    }
164
165
    /**
166
     * @param string $event
167
     *
168
     * @return MeetingActivity
169
     */
170
    public function setEvent($event)
171
    {
172
        $this->event = $event;
173
174
        return $this;
175
    }
176
}
177