Curso   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 101
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 8
lcom 1
cbo 3
dl 0
loc 101
ccs 0
cts 34
cp 0
rs 10
c 0
b 0
f 0

8 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getId() 0 4 1
A getDescripcion() 0 4 1
A setDescripcion() 0 6 1
A __toString() 0 3 1
A removeGrupo() 0 4 1
A getGrupos() 0 4 1
A addGrupo() 0 7 1
1
<?php
2
/*
3
  GESTCONV - Aplicación web para la gestión de la convivencia en centros educativos
4
5
  Copyright (C) 2015: 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
24
use Doctrine\Common\Collections\ArrayCollection;
25
use Doctrine\Common\Collections\Collection;
26
use Doctrine\ORM\Mapping as ORM;
27
28
/**
29
 * @ORM\Entity(repositoryClass="AppBundle\Entity\CursoRepository")
30
 */
31
class Curso
32
{
33
    /**
34
     * @ORM\Id
35
     * @ORM\Column(type="integer")
36
     * @ORM\GeneratedValue
37
     */
38
    protected $id;
39
    
40
    /**
41
     * @ORM\Column(type="string")
42
     * @var string
43
     */
44
    protected $descripcion;
45
46
    /**
47
     * @ORM\OneToMany(targetEntity="Grupo", mappedBy="curso")
48
     * @var Collection
49
     */
50
    protected $grupos = null;
51
    
52
    /**
53
     *
54
     */
55
    public function __construct()
56
    {
57
        $this->grupos = new ArrayCollection();
58
    }
59
    
60
    /**
61
     *
62
     * @return int
63
     */
64
    public function getId()
65
    {
66
        return $this->id;
67
    }
68
    
69
    /**
70
     *
71
     * @return string
72
     */
73
    public function getDescripcion()
74
    {
75
        return $this->descripcion;
76
    }
77
    
78
    /**
79
     *
80
     * @param string $valor
81
     * @return Curso
82
     */
83
    public function setDescripcion($valor)
84
    {
85
        $this->descripcion = $valor;
86
87
        return $this;
88
    }
89
90
    /**
91
     *
92
     * @return string
93
     */
94
    public function __toString() {
95
        return $this->descripcion;
96
    }
97
98
    /**
99
     * Add grupos
100
     *
101
     * @param Grupo $grupos
102
     * @return Curso
103
     */
104
    public function addGrupo(Grupo $grupos)
105
    {
106
        $this->grupos[] = $grupos;
107
        $grupos->setCurso($this);
108
109
        return $this;
110
    }
111
112
    /**
113
     * Remove grupos
114
     *
115
     * @param Grupo $grupos
116
     */
117
    public function removeGrupo(Grupo $grupos)
118
    {
119
        $this->grupos->removeElement($grupos);
120
    }
121
122
    /**
123
     * Get grupos
124
     *
125
     * @return Collection
126
     */
127
    public function getGrupos()
128
    {
129
        return $this->grupos;
130
    }
131
}
132