Completed
Push — master ( 2055e6...14d075 )
by Paweł
17s queued 10s
created

Attachment::setLesson()   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 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace App\Entity;
4
5
use App\Model\AttachmentInterface;
6
use App\Model\LessonInterface;
7
use App\Model\PersistableAwareTrait;
8
use App\Model\TimestampableAwareTrait;
9
use DateTimeImmutable;
10
use Symfony\Component\HttpFoundation\File\File;
11
12
class Attachment implements AttachmentInterface
13
{
14
    use PersistableAwareTrait, TimestampableAwareTrait;
15
16
    private $name;
17
18
    private $lesson;
19
20
    private $fileName;
21
22
    private $file;
23
24
    private $mimeType;
25
26
    public function getName(): ?string
27
    {
28
        return $this->name;
29
    }
30
31
    public function setName(string $name): void
32
    {
33
        $this->name = $name;
34
    }
35
36
    public function getLesson(): ?LessonInterface
37
    {
38
        return $this->lesson;
39
    }
40
41
    public function setLesson(LessonInterface $lesson): void
42
    {
43
        $this->lesson = $lesson;
44
    }
45
46
    public function getFileName(): ?string
47
    {
48
        return $this->fileName;
49
    }
50
51
    public function setFileName(?string $fileName): void
52
    {
53
        $this->fileName = $fileName;
54
    }
55
56
    public function getFile(): ?File
57
    {
58
        return $this->file;
59
    }
60
61
    public function setFile(File $file): void
62
    {
63
        $this->file = $file;
64
        $this->updated = new DateTimeImmutable();
65
    }
66
67
    public function getMimeType(): ?string
68
    {
69
        return $this->mimeType;
70
    }
71
72
    public function setMimeType(?string $mimeType): void
73
    {
74
        $this->mimeType = $mimeType;
75
    }
76
}
77