SamlServiceProvider::setEntityId()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
ccs 0
cts 1
cp 0
crap 2
rs 10
1
<?php
2
3
namespace App\Entity;
4
5
use App\Validator\X509Certificate;
6
use Doctrine\Common\Collections\ArrayCollection;
7
use Doctrine\Common\Collections\Collection;
8
use Doctrine\ORM\Mapping as ORM;
9
use JMS\Serializer\Annotation as Serializer;
10
use Symfony\Component\Validator\Constraints as Assert;
11
12
#[ORM\Entity]
13
class SamlServiceProvider extends ServiceProvider {
14
    #[ORM\Column(type: 'string', unique: true)]
15
    #[Assert\NotBlank]
16
    #[Assert\Length(max: 128)]
17
    private $entityId;
18
19
    #[ORM\Column(type: 'text')]
20
    #[Assert\NotBlank]
21
    #[Assert\Url]
22
    #[Serializer\Exclude]
23
    private $acs;
24
25
    #[ORM\Column(type: 'text')]
26
    #[Assert\NotBlank]
27
    #[Serializer\Exclude]
28
    #[X509Certificate]
29
    private $certificate;
30
31
    #[ORM\ManyToMany(targetEntity: ServiceAttribute::class, mappedBy: 'services')]
32
    #[Serializer\Exclude]
33
    private $attributes;
34
35
    public function __construct() {
36
        parent::__construct();
37
        $this->attributes = new ArrayCollection();
38
    }
39
40
    /**
41
     * @return string
42
     */
43
    public function getEntityId() {
44
        return $this->entityId;
45
    }
46
47
    /**
48
     * @param string $entityId
49
     * @return ServiceProvider
50
     */
51
    public function setEntityId($entityId) {
52
        $this->entityId = $entityId;
53
        return $this;
54
    }
55
56
    /**
57
     * @return string
58
     */
59
    public function getAcs() {
60
        return $this->acs;
61
    }
62
63
    /**
64
     * @param string $acs
65
     * @return ServiceProvider
66
     */
67
    public function setAcs($acs) {
68
        $this->acs = $acs;
69
        return $this;
70
    }
71
72
    /**
73
     * @return string
74
     */
75
    public function getCertificate() {
76
        return $this->certificate;
77
    }
78
79
    /**
80
     * @param string $certificate
81
     * @return ServiceProvider
82
     */
83
    public function setCertificate($certificate) {
84
        $this->certificate = $certificate;
85
        return $this;
86
    }
87
88
    public function getAttributes(): Collection {
89
        return $this->attributes;
90
    }
91
}