attachment   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 16
ccs 4
cts 4
cp 1
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 6 2
1
<?php
2
/**
3
 * @author CONTENT CONTROL http://www.contentcontrol-berlin.de/
4
 * @copyright CONTENT CONTROL http://www.contentcontrol-berlin.de/
5
 * @license http://www.gnu.org/licenses/gpl.html GNU General Public License
6
 */
7
8
namespace midgard\portable\api;
9
10
/**
11
 * @property integer $id Local non-replication-safe database identifier
12
 * @property string $name Filename of the attachment
13
 * @property string $title Title of the attachment
14
 * @property string $location Location of the attachment in the blob directory structure
15
 * @property string $mimetype MIME type of the attachment
16
 * @property string $parentguid GUID of the object the attachment is attached to
17
 * @property string $guid
18
 */
19
class attachment extends mgdobject
20
{
21
    protected string $guid = '';
22
23
    protected $name = '';
24
    protected $title = '';
25
    protected $location = '';
26
    protected $mimetype = '';
27
    protected $parentguid = '';
28
29 5
    public function create() : bool
30
    {
31 5
        if (empty($this->parentguid)) {
32 1
            return false;
33
        }
34 5
        return parent::create();
35
    }
36
}
37