Completed
Push — master ( f93802...a3beff )
by Paweł
34:14
created

File   A

Complexity

Total Complexity 9

Size/Duplication

Total Lines 98
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 9
lcom 0
cbo 1
dl 0
loc 98
ccs 0
cts 23
cp 0
rs 10
c 0
b 0
f 0

9 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getMedia() 0 4 1
A setMedia() 0 4 1
A setId() 0 4 1
A getId() 0 4 1
A setFileExtension() 0 4 1
A getFileExtension() 0 4 1
A getAssetId() 0 4 1
A setAssetId() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the Superdesk Web Publisher Content Bundle.
5
 *
6
 * Copyright 2016 Sourcefabric z.ú. and contributors.
7
 *
8
 * For the full copyright and license information, please see the
9
 * AUTHORS and LICENSE files distributed with this source code.
10
 *
11
 * @copyright 2016 Sourcefabric z.ú
12
 * @license http://www.superdesk.org/license
13
 */
14
15
namespace SWP\Bundle\ContentBundle\Model;
16
17
use SWP\Component\Common\Model\TimestampableTrait;
18
19
class File implements FileInterface
20
{
21
    use TimestampableTrait;
22
23
    /**
24
     * @var string
25
     */
26
    protected $id;
27
28
    /**
29
     * Uploaded file extension.
30
     *
31
     * @var string
32
     */
33
    protected $fileExtension;
34
35
    /**
36
     * @var string
37
     */
38
    protected $assetId;
39
40
    /**
41
     * @var ArticleMediaInterface
42
     */
43
    protected $media;
44
45
    /**
46
     * File constructor.
47
     */
48
    public function __construct()
49
    {
50
        $this->setCreatedAt(new \DateTime());
51
    }
52
53
    /**
54
     * @return ArticleMediaInterface
55
     */
56
    public function getMedia(): ArticleMediaInterface
57
    {
58
        return $this->media;
59
    }
60
61
    /**
62
     * @param ArticleMediaInterface $media
63
     */
64
    public function setMedia(ArticleMediaInterface $media)
65
    {
66
        $this->media = $media;
67
    }
68
69
    /**
70
     * @param string $id
71
     */
72
    public function setId($id)
73
    {
74
        $this->id = $id;
75
    }
76
77
    /**
78
     * {@inheritdoc}
79
     */
80
    public function getId()
81
    {
82
        return $this->id;
83
    }
84
85
    /**
86
     * {@inheritdoc}
87
     */
88
    public function setFileExtension($extension)
89
    {
90
        $this->fileExtension = $extension;
91
    }
92
93
    /**
94
     * {@inheritdoc}
95
     */
96
    public function getFileExtension()
97
    {
98
        return $this->fileExtension;
99
    }
100
101
    /**
102
     * @return string
103
     */
104
    public function getAssetId(): string
105
    {
106
        return $this->assetId;
107
    }
108
109
    /**
110
     * {@inheritdoc}
111
     */
112
    public function setAssetId(string $assetId)
113
    {
114
        $this->assetId = $assetId;
115
    }
116
}
117