GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 45667e...23896c )
by Luis Ramón
02:44
created

Department::__toString()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 2
eloc 2
nc 2
nop 0
1
<?php
2
/*
3
  ÁTICA - Aplicación web para la gestión documental de centros educativos
4
5
  Copyright (C) 2015-2016: Luis Ramón López López
6
7
  This program is free software: you can redistribute it and/or modify
8
  it under the terms of the GNU Affero General Public License as published by
9
  the Free Software Foundation, either version 3 of the License, or
10
  (at your option) any later version.
11
12
  This program is distributed in the hope that it will be useful,
13
  but WITHOUT ANY WARRANTY; without even the implied warranty of
14
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
  GNU Affero General Public License for more details.
16
17
  You should have received a copy of the GNU Affero General Public License
18
  along with this program.  If not, see [http://www.gnu.org/licenses/].
19
*/
20
21
namespace AppBundle\Entity;
22
23
use Doctrine\Common\Collections\Collection;
24
use Doctrine\ORM\Mapping as ORM;
25
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
26
27
/**
28
 * @ORM\Entity
29
 * @UniqueEntity(fields={"name"})
30
 */
31
class Department
32
{
33
    /**
34
     * @ORM\Id
35
     * @ORM\Column(type="integer")
36
     * @ORM\GeneratedValue
37
     * @var int
38
     */
39
    protected $id;
40
41
    /**
42
     * @ORM\Column(type="string")
43
     * @var string
44
     */
45
    protected $name;
46
47
    /**
48
     * @ORM\OneToMany(targetEntity="Training", mappedBy="department")
49
     * @var Collection
50
     */
51
    protected $trainings;
52
53
    /**
54
     * @ORM\ManyToOne(targetEntity="Teacher", inversedBy="directs")
55
     * @var Teacher
56
     */
57
    protected $head;
58
59
    /**
60
     * Constructor
61
     */
62
    public function __construct()
63
    {
64
        $this->trainings = new \Doctrine\Common\Collections\ArrayCollection();
65
    }
66
67
    /**
68
     * Returns departments's display name
69
     *
70
     * @return string
71
     */
72
    public function __toString()
73
    {
74
        return $this->getName() ? $this->getName() : '';
75
    }
76
77
    /**
78
     * Get id
79
     *
80
     * @return integer
81
     */
82
    public function getId()
83
    {
84
        return $this->id;
85
    }
86
87
    /**
88
     * Set name
89
     *
90
     * @param string $name
91
     *
92
     * @return Department
93
     */
94
    public function setName($name)
95
    {
96
        $this->name = $name;
97
98
        return $this;
99
    }
100
101
    /**
102
     * Get name
103
     *
104
     * @return string
105
     */
106
    public function getName()
107
    {
108
        return $this->name;
109
    }
110
111
    /**
112
     * Add training
113
     *
114
     * @param Training $training
115
     *
116
     * @return Department
117
     */
118
    public function addTraining(Training $training)
119
    {
120
        $this->trainings[] = $training;
121
122
        return $this;
123
    }
124
125
    /**
126
     * Remove training
127
     *
128
     * @param Training $training
129
     */
130
    public function removeTraining(Training $training)
131
    {
132
        $this->trainings->removeElement($training);
133
    }
134
135
    /**
136
     * Get trainings
137
     *
138
     * @return Collection
139
     */
140
    public function getTrainings()
141
    {
142
        return $this->trainings;
143
    }
144
145
    /**
146
     * Set head
147
     *
148
     * @param Teacher $head
149
     *
150
     * @return Department
151
     */
152
    public function setHead(Teacher $head = null)
153
    {
154
        $this->head = $head;
155
156
        return $this;
157
    }
158
159
    /**
160
     * Get head
161
     *
162
     * @return Teacher
163
     */
164
    public function getHead()
165
    {
166
        return $this->head;
167
    }
168
}
169