DocumentAttachment::getDownloadUrl()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Picqer\Financials\Exact;
4
5
/**
6
 * Class DocumentAttachment.
7
 *
8
 * @see https://start.exactonline.nl/docs/HlpRestAPIResourcesDetails.aspx?name=documentsDocumentAttachments
9
 *
10
 * @property string $ID Primary key
11
 * @property string $Attachment Contains the attachment
12
 * @property string $Document Reference to the Document
13
 * @property string $FileName Filename of the attachment
14
 * @property float $FileSize File size of the attachment
15
 * @property string $Url Url of the attachment. To get the file in its original format (xml, jpg, pdf, etc.) append &Download=1 to the url.
16
 */
17
class DocumentAttachment extends Model
18
{
19
    use Query\Findable;
20
    use Persistance\Storable;
21
    use Persistance\Downloadable;
22
23
    protected $fillable = [
24
        'ID',
25
        'Attachment',
26
        'Document',
27
        'FileName',
28
        'FileSize',
29
        'Url',
30
    ];
31
32
    protected $url = 'documents/DocumentAttachments';
33
34
    /**
35
     * @return string
36
     */
37
    public function getDownloadUrl()
38
    {
39
        return $this->Url . '&Download=1';
40
    }
41
}
42