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 ( e88d08...f80a23 )
by Luis Ramón
03:31
created

Student   A

Complexity

Total Complexity 10

Size/Duplication

Total Lines 142
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 4
Bugs 0 Features 0
Metric Value
wmc 10
c 4
b 0
f 0
lcom 1
cbo 2
dl 0
loc 142
rs 10

10 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A setCode() 0 6 1
A getCode() 0 4 1
A getId() 0 4 1
A setGroup() 0 6 1
A getGroup() 0 4 1
A addAgreement() 0 6 1
A removeAgreement() 0 4 1
A getAgreements() 0 4 1
A setPerson() 0 6 1
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={"code"})
30
 */
31
class Student
32
{
33
    /**
34
     * @ORM\Id
35
     * @ORM\OneToOne(targetEntity="Person")
36
     * @ORM\JoinColumn(name="id")
37
     * @var Person
38
     */
39
    protected $person;
40
41
    /**
42
     * @ORM\Column(type="string")
43
     * @var string
44
     */
45
    protected $code;
46
47
    /**
48
     * @ORM\ManyToOne(targetEntity="Group", inversedBy="students")
49
     * @ORM\JoinColumn(nullable=false)
50
     */
51
    protected $group;
52
53
    /**
54
     * @ORM\OneToMany(targetEntity="Agreement", mappedBy="student")
55
     * @var Collection
56
     */
57
    protected $agreements;
58
59
    /**
60
     * Constructor
61
     */
62
    public function __construct()
63
    {
64
        $this->agreements = new \Doctrine\Common\Collections\ArrayCollection();
65
    }
66
67
    /**
68
     * Set code
69
     *
70
     * @param string $code
71
     *
72
     * @return Student
73
     */
74
    public function setCode($code)
75
    {
76
        $this->code = $code;
77
78
        return $this;
79
    }
80
81
    /**
82
     * Get code
83
     *
84
     * @return string
85
     */
86
    public function getCode()
87
    {
88
        return $this->code;
89
    }
90
91
    /**
92
     * Set person
93
     *
94
     * @param Person $person
95
     *
96
     * @return Student
97
     */
98
    public function setPerson(Person $person)
99
    {
100
        $this->person = $person;
101
102
        return $this;
103
    }
104
105
    /**
106
     * Get person
107
     *
108
     * @return Person
109
     */
110
    public function getId()
111
    {
112
        return $this->person;
113
    }
114
115
    /**
116
     * Set group
117
     *
118
     * @param Group $group
119
     *
120
     * @return Student
121
     */
122
    public function setGroup(Group $group)
123
    {
124
        $this->group = $group;
125
126
        return $this;
127
    }
128
129
    /**
130
     * Get group
131
     *
132
     * @return Group
133
     */
134
    public function getGroup()
135
    {
136
        return $this->group;
137
    }
138
139
    /**
140
     * Add agreement
141
     *
142
     * @param Agreement $agreement
143
     *
144
     * @return Student
145
     */
146
    public function addAgreement(Agreement $agreement)
147
    {
148
        $this->agreements[] = $agreement;
149
150
        return $this;
151
    }
152
153
    /**
154
     * Remove agreement
155
     *
156
     * @param Agreement $agreement
157
     */
158
    public function removeAgreement(Agreement $agreement)
159
    {
160
        $this->agreements->removeElement($agreement);
161
    }
162
163
    /**
164
     * Get agreements
165
     *
166
     * @return Collection
167
     */
168
    public function getAgreements()
169
    {
170
        return $this->agreements;
171
    }
172
}
173