Completed
Push — master ( e6cd79...15515b )
by Mike
02:12
created

FileEntryPoint::setupResponse()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace SugarAPI\SDK\EntryPoint\Abstracts\GET;
4
5
use SugarAPI\SDK\EntryPoint\Abstracts\GET\JSONEntryPoint as GETEntryPoint;
6
use SugarAPI\SDK\Request\GETFile;
7
use SugarAPI\SDK\Response\File as FileResponse;
8
9
class FileEntryPoint extends GETEntryPoint {
10
11
    protected $downloadDir = null;
12
13
    protected function setupRequest() {
14
        $this->Request = new GETFile();
15
    }
16
    protected function setupResponse() {
17
        $this->Response = new FileResponse($this->Request->getResponse(),$this->Request->getCurlObject(),$this->downloadDir);
18
    }
19
20
    public function downloadTo($path){
21
        $this->downloadDir = $path;
22
        return $this;
23
    }
24
25
}