Membership   A
last analyzed

Complexity

Total Complexity 9

Size/Duplication

Total Lines 142
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 9
c 0
b 0
f 0
lcom 0
cbo 0
dl 0
loc 142
rs 10

9 Methods

Rating   Name   Duplication   Size   Complexity  
A getId() 0 4 1
A setValidFrom() 0 6 1
A getValidFrom() 0 4 1
A setValidUntil() 0 6 1
A getValidUntil() 0 4 1
A setUser() 0 6 1
A getUser() 0 4 1
A setOrganization() 0 6 1
A getOrganization() 0 4 1
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
25
/**
26
 * @ORM\Entity(repositoryClass="AppBundle\Repository\MembershipRepository")
27
 */
28
class Membership
29
{
30
    /**
31
     * @ORM\Id
32
     * @ORM\GeneratedValue(strategy="AUTO")
33
     * @ORM\Column(type="integer")
34
     * @var int
35
     */
36
    private $id;
37
38
    /**
39
     * @ORM\ManyToOne(targetEntity="User", inversedBy="memberships")
40
     * @ORM\JoinColumn(nullable=false)
41
     * @var User
42
     */
43
    private $user;
44
45
    /**
46
     * @ORM\ManyToOne(targetEntity="Organization", inversedBy="memberships")
47
     * @ORM\JoinColumn(nullable=false)
48
     * @var Organization
49
     */
50
    private $organization;
51
52
    /**
53
     * @ORM\Column(type="datetime", nullable=false)
54
     * @var \DateTime
55
     */
56
    private $validFrom;
57
58
    /**
59
     * @ORM\Column(type="datetime", nullable=true)
60
     * @var \DateTime
61
     */
62
    private $validUntil;
63
64
    /**
65
     * Get id
66
     *
67
     * @return integer
68
     */
69
    public function getId()
70
    {
71
        return $this->id;
72
    }
73
74
    /**
75
     * Set validFrom
76
     *
77
     * @param \DateTime $validFrom
78
     *
79
     * @return Membership
80
     */
81
    public function setValidFrom(\DateTime $validFrom)
82
    {
83
        $this->validFrom = $validFrom;
84
85
        return $this;
86
    }
87
88
    /**
89
     * Get validFrom
90
     *
91
     * @return \DateTime
92
     */
93
    public function getValidFrom()
94
    {
95
        return $this->validFrom;
96
    }
97
98
    /**
99
     * Set validUntil
100
     *
101
     * @param \DateTime|null $validUntil
102
     *
103
     * @return Membership
104
     */
105
    public function setValidUntil(\DateTime $validUntil = null)
106
    {
107
        $this->validUntil = $validUntil;
108
109
        return $this;
110
    }
111
112
    /**
113
     * Get validUntil
114
     *
115
     * @return \DateTime
116
     */
117
    public function getValidUntil()
118
    {
119
        return $this->validUntil;
120
    }
121
122
    /**
123
     * Set user
124
     *
125
     * @param User $user
126
     *
127
     * @return Membership
128
     */
129
    public function setUser(User $user)
130
    {
131
        $this->user = $user;
132
133
        return $this;
134
    }
135
136
    /**
137
     * Get user
138
     *
139
     * @return User
140
     */
141
    public function getUser()
142
    {
143
        return $this->user;
144
    }
145
146
    /**
147
     * Set organization
148
     *
149
     * @param Organization $organization
150
     *
151
     * @return Membership
152
     */
153
    public function setOrganization(Organization $organization)
154
    {
155
        $this->organization = $organization;
156
157
        return $this;
158
    }
159
160
    /**
161
     * Get organization
162
     *
163
     * @return Organization
164
     */
165
    public function getOrganization()
166
    {
167
        return $this->organization;
168
    }
169
}
170