Passed
Push — master ( 7438ce...69adc8 )
by Guilherme
01:29 queued 11s
created

RemoteClaimAuthorization::getClaimProvider()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * This file is part of the login-cidadao project or it's bundles.
4
 *
5
 * (c) Guilherme Donato <guilhermednt on github>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace LoginCidadao\RemoteClaimsBundle\Entity;
12
13
use Doctrine\ORM\Mapping as ORM;
14
use LoginCidadao\CoreBundle\Model\PersonInterface;
15
use LoginCidadao\OAuthBundle\Model\ClientInterface;
16
use LoginCidadao\RemoteClaimsBundle\Model\ClaimProviderInterface;
17
use LoginCidadao\RemoteClaimsBundle\Model\RemoteClaimAuthorizationInterface;
18
use LoginCidadao\RemoteClaimsBundle\Model\TagUri;
19
20
/**
21
 * Class RemoteClaimAuthorization
22
 * @package LoginCidadao\RemoteClaimsBundle\Entity
23
 * @ORM\Entity(repositoryClass="LoginCidadao\RemoteClaimsBundle\Entity\RemoteClaimAuthorizationRepository")
24
 * @ORM\Table(name="remote_claim_authorization")
25
 */
26
class RemoteClaimAuthorization implements RemoteClaimAuthorizationInterface
27
{
28
    /**
29
     * @ORM\Id
30
     * @ORM\Column(type="integer")
31
     * @ORM\GeneratedValue(strategy="AUTO")
32
     */
33
    protected $id;
34
35
    /**
36
     * @var ClaimProviderInterface
37
     *
38
     * @ORM\ManyToOne(targetEntity="LoginCidadao\OAuthBundle\Entity\Client")
39
     * @ORM\JoinColumn(name="claim_provider_id", referencedColumnName="id")
40
     */
41
    private $claimProvider;
42
43
    /**
44
     * @var ClientInterface
45
     *
46
     * @ORM\ManyToOne(targetEntity="LoginCidadao\OAuthBundle\Entity\Client")
47
     * @ORM\JoinColumn(name="client_id", referencedColumnName="id")
48
     */
49
    private $client;
50
51
    /**
52
     * @var PersonInterface
53
     *
54
     * @ORM\ManyToOne(targetEntity="LoginCidadao\CoreBundle\Entity\Person")
55
     * @ORM\JoinColumn(name="person_id", referencedColumnName="id")
56
     */
57
    private $person;
58
59
    /**
60
     * @var TagUri
61
     *
62
     * @ORM\Column(name="claim_name", type="string", length=255, nullable=false)
63
     */
64
    private $claimName;
65
66
    /**
67
     * @var string
68
     *
69
     * @ORM\Column(name="access_token", type="string", length=255, nullable=false)
70
     */
71
    private $accessToken;
72
73
    /**
74
     * @param ClaimProviderInterface $claimProvider
75
     * @return RemoteClaimAuthorizationInterface
76
     */
77 4
    public function setClaimProvider(ClaimProviderInterface $claimProvider)
78
    {
79 4
        $this->claimProvider = $claimProvider;
80
81 4
        return $this;
82
    }
83
84
    /**
85
     * @param string $accessToken
86
     * @return RemoteClaimAuthorizationInterface
87
     */
88 6
    public function setAccessToken($accessToken)
89
    {
90 6
        $this->accessToken = $accessToken;
91
92 6
        return $this;
93
    }
94
95
    /**
96
     * @return ClaimProviderInterface
97
     */
98 1
    public function getClaimProvider()
99
    {
100 1
        return $this->claimProvider;
101
    }
102
103
    /**
104
     * Defines the entity that will be given access to the information provided by the Claim Provider
105
     *
106
     * @param ClientInterface $client
107
     * @return RemoteClaimAuthorizationInterface
108
     */
109 8
    public function setClient(ClientInterface $client)
110
    {
111 8
        $this->client = $client;
112
113 8
        return $this;
114
    }
115
116
    /**
117
     * @return ClientInterface
118
     */
119 1
    public function getClient()
120
    {
121 1
        return $this->client;
122
    }
123
124
    /**
125
     * Set the tag this authorization refers to.
126
     *
127
     * @param TagUri $claimName
128
     * @return RemoteClaimAuthorizationInterface
129
     */
130 8
    public function setClaimName(TagUri $claimName)
131
    {
132 8
        $this->claimName = $claimName;
133
134 8
        return $this;
135
    }
136
137
    /**
138
     * @return TagUri
139
     */
140 2
    public function getClaimName()
141
    {
142 2
        return $this->claimName;
143
    }
144
145
    /**
146
     * @return string
147
     */
148 2
    public function getAccessToken()
149
    {
150 2
        return $this->accessToken;
151
    }
152
153
    /**
154
     * @return PersonInterface
155
     */
156 1
    public function getPerson()
157
    {
158 1
        return $this->person;
159
    }
160
161
    /**
162
     * @param PersonInterface $person
163
     * @return RemoteClaimAuthorization
164
     */
165 8
    public function setPerson(PersonInterface $person)
166
    {
167 8
        $this->person = $person;
168
169 8
        return $this;
170
    }
171
}
172