Passed
Push — master ( e66a3e...15c60f )
by Paweł
04:21
created

Attachment::getLesson()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 1
c 1
b 0
f 1
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace App\Entity;
4
5
use App\Model\AttachmentInterface;
6
use App\Model\LessonAwareTrait;
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;
15
    use TimestampableAwareTrait;
16
    use LessonAwareTrait;
17
18
    private $name;
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 getFileName(): ?string
37
    {
38
        return $this->fileName;
39
    }
40
41
    public function setFileName(?string $fileName): void
42
    {
43
        $this->fileName = $fileName;
44
    }
45
46
    public function getFile(): ?File
47
    {
48
        return $this->file;
49
    }
50
51
    public function setFile(File $file): void
52
    {
53
        $this->file = $file;
54
        $this->updated = new DateTimeImmutable();
55
    }
56
57
    public function getMimeType(): ?string
58
    {
59
        return $this->mimeType;
60
    }
61
62
    public function setMimeType(?string $mimeType): void
63
    {
64
        $this->mimeType = $mimeType;
65
    }
66
}
67