-
Notifications
You must be signed in to change notification settings - Fork 179
/
TemporaryLink.php
64 lines (56 loc) · 1.11 KB
/
TemporaryLink.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
namespace Kunnu\Dropbox\Models;
class TemporaryLink extends BaseModel
{
/**
* The temporary link
*
* @var string
*/
protected $link;
/**
* File Metadata
*
* @var \Kunnu\Dropbox\Models\FileMetadata
*/
protected $metadata;
/**
* Create a new TemporaryLink instance
*
* @param array $data
*/
public function __construct(array $data)
{
parent::__construct($data);
$this->link = $this->getDataProperty('link');
$this->setMetadata();
}
/**
* Set Metadata
*/
protected function setMetadata()
{
$metadata = $this->getDataProperty('metadata');
if (is_array($metadata)) {
$this->metadata = new FileMetadata($metadata);
}
}
/**
* The metadata for the file
*
* @return \Kunnu\Dropbox\Models\FileMetadata
*/
public function getMetadata()
{
return $this->metadata;
}
/**
* Get the temporary link
*
* @return string
*/
public function getLink()
{
return $this->link;
}
}