HistoricPeriod::getOrganization()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 4
rs 10
c 1
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/*
3
  ÁTICA - Aplicación web para la gestión documental de centros educativos
4
5
  Copyright (C) 2015-2017: 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\ORM\Mapping as ORM;
24
use Gedmo\Mapping\Annotation as Gedmo;
25
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
26
27
/**
28
 * @ORM\Entity()
29
 * @UniqueEntity({"name", "organization"})
30
 */
31
class HistoricPeriod
32
{
33
    /**
34
     * @ORM\Id
35
     * @ORM\GeneratedValue(strategy="AUTO")
36
     * @ORM\Column(type="integer")
37
     * @var int
38
     */
39
    private $id;
40
41
    /**
42
     * @ORM\Column(type="string")
43
     * @var string
44
     */
45
    private $name;
46
47
    /**
48
     * @ORM\ManyToOne(targetEntity="Organization")
49
     * @Gedmo\SortableGroup()
50
     * @ORM\JoinColumn(nullable=false, onDelete="CASCADE")
51
     */
52
    private $organization;
53
54
    /**
55
     * @Gedmo\SortablePosition()
56
     * @ORM\Column(type="integer")
57
     * @var int
58
     */
59
    private $position;
60
61
    /**
62
     * Get id
63
     *
64
     * @return integer
65
     */
66
    public function getId()
67
    {
68
        return $this->id;
69
    }
70
71
    /**
72
     * Set name
73
     *
74
     * @param string $name
75
     *
76
     * @return HistoricPeriod
77
     */
78
    public function setName($name)
79
    {
80
        $this->name = $name;
81
82
        return $this;
83
    }
84
85
    /**
86
     * Get name
87
     *
88
     * @return string
89
     */
90
    public function getName()
91
    {
92
        return $this->name;
93
    }
94
95
    /**
96
     * Set position
97
     *
98
     * @param integer $position
99
     *
100
     * @return HistoricPeriod
101
     */
102
    public function setPosition($position)
103
    {
104
        $this->position = $position;
105
106
        return $this;
107
    }
108
109
    /**
110
     * Get position
111
     *
112
     * @return integer
113
     */
114
    public function getPosition()
115
    {
116
        return $this->position;
117
    }
118
119
    /**
120
     * Set organization
121
     *
122
     * @param \AppBundle\Entity\Organization $organization
123
     *
124
     * @return HistoricPeriod
125
     */
126
    public function setOrganization(\AppBundle\Entity\Organization $organization)
127
    {
128
        $this->organization = $organization;
129
130
        return $this;
131
    }
132
133
    /**
134
     * Get organization
135
     *
136
     * @return \AppBundle\Entity\Organization
137
     */
138
    public function getOrganization()
139
    {
140
        return $this->organization;
141
    }
142
}
143