Passed
Push — master ( 30a646...7ef6af )
by Julito
29:23
created

SessionCategory::getAccessUrlId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
/* For licensing terms, see /license.txt */
3
4
namespace Chamilo\CoreBundle\Entity;
5
6
use Doctrine\ORM\Mapping as ORM;
7
8
/**
9
 * SessionCategory.
10
 *
11
 * @ORM\Table(name="session_category")
12
 * @ORM\Entity
13
 */
14
class SessionCategory
15
{
16
    /**
17
     * @var int
18
     *
19
     * @ORM\Column(name="id", type="integer", nullable=false, unique=false)
20
     * @ORM\Id
21
     * @ORM\GeneratedValue
22
     */
23
    protected $id;
24
25
    /**
26
     * @ORM\ManyToOne(targetEntity="AccessUrl", inversedBy="sessionCategory", cascade={"persist"})
27
     * @ORM\JoinColumn(name="access_url_id", referencedColumnName="id")
28
     */
29
    protected $url;
30
31
    /**
32
     * @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\Session", mappedBy="category")
33
     */
34
    protected $session;
35
36
    /**
37
     * @var string
38
     *
39
     * @ORM\Column(name="name", type="string", length=100, nullable=true, unique=false)
40
     */
41
    protected $name;
42
43
    /**
44
     * @var \DateTime
45
     *
46
     * @ORM\Column(name="date_start", type="date", nullable=true, unique=false)
47
     */
48
    protected $dateStart;
49
50
    /**
51
     * @var \DateTime
52
     *
53
     * @ORM\Column(name="date_end", type="date", nullable=true, unique=false)
54
     */
55
    protected $dateEnd;
56
57
    /**
58
     * @return string
59
     */
60
    public function __toString()
61
    {
62
        return (string) $this->name;
63
    }
64
65
    /**
66
     * Set url.
67
     *
68
     * @param AccessUrl $url
69
     *
70
     * @return SessionCategory
71
     */
72
    public function setUrl(AccessUrl $url)
73
    {
74
        $this->url = $url;
75
76
        return $this;
77
    }
78
79
    /**
80
     * @return AccessUrl
81
     */
82
    public function getUrl(): AccessUrl
83
    {
84
        return $this->url;
85
    }
86
87
    /**
88
     * Get id.
89
     *
90
     * @return int
91
     */
92
    public function getId()
93
    {
94
        return $this->id;
95
    }
96
97
    /**
98
     * Set name.
99
     *
100
     * @param string $name
101
     *
102
     * @return SessionCategory
103
     */
104
    public function setName($name)
105
    {
106
        $this->name = $name;
107
108
        return $this;
109
    }
110
111
    /**
112
     * Get name.
113
     *
114
     * @return string
115
     */
116
    public function getName()
117
    {
118
        return $this->name;
119
    }
120
121
    /**
122
     * Set dateStart.
123
     *
124
     * @param \DateTime $dateStart
125
     *
126
     * @return SessionCategory
127
     */
128
    public function setDateStart($dateStart)
129
    {
130
        $this->dateStart = $dateStart;
131
132
        return $this;
133
    }
134
135
    /**
136
     * Get dateStart.
137
     *
138
     * @return \DateTime
139
     */
140
    public function getDateStart()
141
    {
142
        return $this->dateStart;
143
    }
144
145
    /**
146
     * Set dateEnd.
147
     *
148
     * @param \DateTime $dateEnd
149
     *
150
     * @return SessionCategory
151
     */
152
    public function setDateEnd($dateEnd)
153
    {
154
        $this->dateEnd = $dateEnd;
155
156
        return $this;
157
    }
158
159
    /**
160
     * Get dateEnd.
161
     *
162
     * @return \DateTime
163
     */
164
    public function getDateEnd()
165
    {
166
        return $this->dateEnd;
167
    }
168
}
169