Passed
Push — master ( 3d30f2...809d71 )
by Marcel
05:26
created

ServiceProviderConfirmation::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 2
ccs 0
cts 0
cp 0
crap 2
rs 10
1
<?php
2
3
namespace App\Entity;
4
5
use DateTime;
6
use Doctrine\ORM\Mapping as ORM;
7
use Gedmo\Mapping\Annotation as Gedmo;
8
9
#[ORM\Entity]
10
class ServiceProviderConfirmation {
11
12
    #[ORM\Id]
13
    #[ORM\ManyToOne(targetEntity: User::class)]
14
    #[ORM\JoinColumn(onDelete: 'CASCADE')]
15
    private $user;
16
17
    #[ORM\Id]
18
    #[ORM\ManyToOne(targetEntity: ServiceProvider::class)]
19
    #[ORM\JoinColumn(onDelete: 'CASCADE')]
20
    private $serviceProvider;
21
22
    #[ORM\Column(type: 'datetime')]
23
    #[Gedmo\Timestampable(on: 'update')]
24
    private $dateTime;
25
26
    #[ORM\Column(type: 'json')]
27
    private array $attributes = [ ];
28
29
    public function __construct() {
30
        $this->dateTime = new DateTime();
31
    }
32
33
    /**
34
     * @return User|null
35
     */
36
    public function getUser() {
37
        return $this->user;
38
    }
39
40
    /**
41
     * @return ServiceProviderConfirmation
42
     */
43
    public function setUser(User $user) {
44
        $this->user = $user;
45
        return $this;
46
    }
47
48
    /**
49
     * @return ServiceProvider|null
50
     */
51
    public function getServiceProvider() {
52
        return $this->serviceProvider;
53
    }
54
55
    /**
56
     * @return ServiceProviderConfirmation
57
     */
58
    public function setServiceProvider(ServiceProvider $serviceProvider) {
59
        $this->serviceProvider = $serviceProvider;
60
        return $this;
61
    }
62
63
    public function getDateTime(): ?DateTime {
64
        return $this->dateTime;
65
    }
66
67
    /**
68
     * @return string[]
69
     */
70
    public function getAttributes() {
71
        return $this->attributes;
72
    }
73
74
    /**
75
     * @param string[] $attributes
76
     * @return ServiceProviderConfirmation
77
     */
78
    public function setAttributes(array $attributes) {
79
        $this->attributes = $attributes;
80
        return $this;
81
    }
82
}