attachment::create()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 0
Metric Value
cc 2
eloc 3
c 0
b 0
f 0
nc 2
nop 0
dl 0
loc 6
ccs 4
cts 4
cp 1
crap 2
rs 10
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