Passed
Push — master ( 2cb959...2b5b03 )
by Julito
11:13 queued 10s
created

AttemptFeedback::getAttempt()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
/* For licensing terms, see /license.txt */
6
7
namespace Chamilo\CoreBundle\Entity;
8
9
use Doctrine\ORM\Mapping as ORM;
10
use Gedmo\Timestampable\Traits\TimestampableEntity;
11
use Symfony\Component\Uid\Uuid;
12
use Symfony\Component\Validator\Constraints as Assert;
13
14
/**
15
 * @ORM\Table(
16
 *     name="attempt_feedback",
17
 * )
18
 * @ORM\Entity
19
 */
20
class AttemptFeedback
21
{
22
    use TimestampableEntity;
23
24
    /**
25
     * @ORM\Id
26
     * @ORM\Column(type="uuid")
27
     */
28
    protected Uuid $id;
29
30
    /**
31
     * @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\TrackEAttempt", inversedBy="attemptFiles")
32
     * @ORM\JoinColumn(name="attempt_id", referencedColumnName="id", onDelete="CASCADE")
33
     */
34
    #[Assert\NotNull]
35
    protected TrackEAttempt $attempt;
36
37
    /**
38
     * @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\User")
39
     * @ORM\JoinColumn(name="user_id", referencedColumnName="id", onDelete="CASCADE")
40
     */
41
    #[Assert\NotNull]
42
    protected User $user;
43
44
    /**
45
     * @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Asset", cascade={"remove"} )
46
     * @ORM\JoinColumn(name="asset_id", referencedColumnName="id", onDelete="CASCADE")
47
     */
48
    protected ?Asset $asset = null;
49
50
    /**
51
     * @ORM\Column(name="comment", type="text", nullable=false)
52
     */
53
    protected string $comment;
54
55
    public function __construct()
56
    {
57
        $this->id = Uuid::v4();
58
        $this->comment = '';
59
    }
60
61
    public function getId(): Uuid
62
    {
63
        return $this->id;
64
    }
65
66
    public function getAttempt(): TrackEAttempt
67
    {
68
        return $this->attempt;
69
    }
70
71
    public function setAttempt(TrackEAttempt $attempt): self
72
    {
73
        $this->attempt = $attempt;
74
75
        return $this;
76
    }
77
78
    public function getUser(): User
79
    {
80
        return $this->user;
81
    }
82
83
    public function setUser(User $user): self
84
    {
85
        $this->user = $user;
86
87
        return $this;
88
    }
89
90
    public function getAsset(): ?Asset
91
    {
92
        return $this->asset;
93
    }
94
95
    public function setAsset(?Asset $asset): self
96
    {
97
        $this->asset = $asset;
98
99
        return $this;
100
    }
101
102
    public function getComment(): string
103
    {
104
        return $this->comment;
105
    }
106
107
    public function setComment(string $comment): self
108
    {
109
        $this->comment = $comment;
110
111
        return $this;
112
    }
113
}
114