Passed
Pull Request — master (#6100)
by Angel Fernando Quiroz
11:43
created

UserAuthSource   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 63
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 27
dl 0
loc 63
rs 10
c 1
b 0
f 0
wmc 7

7 Methods

Rating   Name   Duplication   Size   Complexity  
A getId() 0 3 1
A setUrl() 0 5 1
A getAuthentication() 0 3 1
A setAuthentication() 0 5 1
A getUrl() 0 3 1
A getUser() 0 3 1
A setUser() 0 5 1
1
<?php
2
3
/* For licensing terms, see /license.txt */
4
5
declare(strict_types=1);
6
7
namespace Chamilo\CoreBundle\Entity;
8
9
use Chamilo\CoreBundle\Repository\UserAuthSourceRepository;
10
use Doctrine\ORM\Mapping as ORM;
11
12
//agregar url_id priority
13
#[ORM\Entity(repositoryClass: UserAuthSourceRepository::class)]
14
class UserAuthSource
15
{
16
    public const PLATFORM = 'platform';
17
    public const CAS = 'cas';
18
    public const LDAP = 'extldap';
19
20
21
    #[ORM\Id]
22
    #[ORM\GeneratedValue]
23
    #[ORM\Column]
24
    private ?int $id = null;
25
26
    #[ORM\Column(length: 255)]
27
    private ?string $authentication = null;
28
29
    #[ORM\ManyToOne]
30
    #[ORM\JoinColumn(nullable: false)]
31
    private ?AccessUrl $url = null;
32
33
    #[ORM\ManyToOne(inversedBy: 'authSources')]
34
    #[ORM\JoinColumn(nullable: false)]
35
    private ?User $user = null;
36
37
    public function getId(): ?int
38
    {
39
        return $this->id;
40
    }
41
42
    public function getAuthentication(): ?string
43
    {
44
        return $this->authentication;
45
    }
46
47
    public function setAuthentication(string $authentication): static
48
    {
49
        $this->authentication = $authentication;
50
51
        return $this;
52
    }
53
54
    public function getUrl(): ?AccessUrl
55
    {
56
        return $this->url;
57
    }
58
59
    public function setUrl(?AccessUrl $url): static
60
    {
61
        $this->url = $url;
62
63
        return $this;
64
    }
65
66
    public function getUser(): ?User
67
    {
68
        return $this->user;
69
    }
70
71
    public function setUser(?User $user): static
72
    {
73
        $this->user = $user;
74
75
        return $this;
76
    }
77
}
78