Passed
Push — 1.11.x ( b4ce57...e435f5 )
by Julito
09:28
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 Chamilo\CoreBundle\Entity\Course;
8
use Chamilo\CoreBundle\Entity\CourseRelUser;
9
use Chamilo\CoreBundle\Entity\Session;
10
use Chamilo\CoreBundle\Entity\SessionRelCourseRelUser;
11
use Chamilo\CourseBundle\Entity\CGroupInfo;
12
use Chamilo\PluginBundle\Zoom\API\MeetingInfoGet;
13
use Chamilo\PluginBundle\Zoom\API\MeetingListItem;
14
use Chamilo\PluginBundle\Zoom\API\MeetingSettings;
15
use Chamilo\UserBundle\Entity\User;
16
use Database;
17
use DateInterval;
18
use DateTime;
19
use DateTimeZone;
20
use Doctrine\Common\Collections\ArrayCollection;
21
use Doctrine\ORM\Mapping as ORM;
22
use Exception;
23
24
/**
25
 * Class Meeting.
26
 *
27
 * @ORM\Entity()
28
 * @ORM\Table(name="plugin_zoom_meeting_activity")
29
 * @ORM\HasLifecycleCallbacks
30
 */
31
class MeetingActivity
32
{
33
    /**
34
     * @var int
35
     * @ORM\Column(type="integer")
36
     * @ORM\Id
37
     * @ORM\GeneratedValue()
38
     */
39
    protected $id;
40
41
    /**
42
     * @var Meeting
43
     * @ORM\ManyToOne(targetEntity="Meeting", inversedBy="activities")
44
     * @ORM\JoinColumn(name="meeting_id")
45
     */
46
    protected $meeting;
47
48
    /**
49
     * @var string
50
     * @ORM\Column(type="string", name="name", length=255, nullable=false)
51
     */
52
    protected $name;
53
54
    /**
55
     * @var string
56
     * @ORM\Column(type="string", name="type", length=255, nullable=false)
57
     */
58
    protected $type;
59
60
    /**
61
     * @var string
62
     * @ORM\Column(type="text", name="event", nullable=true)
63
     */
64
    protected $event;
65
66
    public function __construct()
67
    {
68
    }
69
70
    /**
71
     * @return string
72
     */
73
    public function __toString()
74
    {
75
        return sprintf('Activity %d', $this->id);
76
    }
77
78
    /**
79
     * @return int
80
     */
81
    public function getId()
82
    {
83
        return $this->id;
84
    }
85
86
    /**
87
     * @return Meeting
88
     */
89
    public function getMeeting()
90
    {
91
        return $this->meeting;
92
    }
93
94
    /**
95
     * @param Meeting $meeting
96
     *
97
     * @return MeetingActivity
98
     */
99
    public function setMeeting($meeting)
100
    {
101
        $this->meeting = $meeting;
102
103
        return $this;
104
    }
105
106
    /**
107
     * @return string
108
     */
109
    public function getName()
110
    {
111
        return $this->name;
112
    }
113
114
    /**
115
     * @param string $name
116
     *
117
     * @return MeetingActivity
118
     */
119
    public function setName($name)
120
    {
121
        $this->name = $name;
122
123
        return $this;
124
    }
125
126
    /**
127
     * @return string
128
     */
129
    public function getType()
130
    {
131
        return $this->type;
132
    }
133
134
    /**
135
     * @param string $type
136
     *
137
     * @return MeetingActivity
138
     */
139
    public function setType($type)
140
    {
141
        $this->type = $type;
142
143
        return $this;
144
    }
145
146
    /**
147
     * @return string
148
     */
149
    public function getEvent()
150
    {
151
        return $this->event;
152
    }
153
154
    public function getEventDecoded()
155
    {
156
        if (!empty($this->event)) {
157
            return json_decode($this->event);
158
        }
159
160
        return '';
161
    }
162
163
    /**
164
     * @param string $event
165
     *
166
     * @return MeetingActivity
167
     */
168
    public function setEvent($event)
169
    {
170
        $this->event = $event;
171
172
        return $this;
173
    }
174
175
176
}
177