Completed
Push — master ( 2994aa...19d116 )
by Patrick
08:28
created

FolderSharingInfo::isReadOnly()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 4
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 4
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
namespace Dropbox\Models;
3
4 View Code Duplication
class FolderSharingInfo extends BaseModel
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
5
{
6
7
    /**
8
     * True if the file or folder is inside a read-only shared folder.
9
     *
10
     * @var bool
11
     */
12
    protected $read_only;
13
14
    /**
15
     * ID of shared folder that holds this folder.
16
     * Set if the folder is contained by a shared folder.
17
     *
18
     * @var string
19
     */
20
    protected $parent_shared_folder_id;
21
22
    /**
23
     * If this folder is a shared folder mount point,
24
     * the ID of the shared folder mounted at this location.
25
     *
26
     * @var string
27
     */
28
    protected $shared_folder_id;
29
30
31
    /**
32
     * Create a new Folder Sharing Info instance
33
     *
34
     * @param array $data
35
     */
36 1
    public function __construct(array $data)
37
    {
38 1
        parent::__construct($data);
39 1
        $this->read_only = $this->getDataProperty('read_only');
40 1
        $this->shared_folder_id = $this->getDataProperty('shared_folder_id');
41 1
        $this->parent_shared_folder_id = $this->getDataProperty('parent_shared_folder_id');
42 1
    }
43
44
    /**
45
     * True if the folder or folder is inside a read-only shared folder.
46
     *
47
     * @return bool
48
     */
49
    public function isReadOnly()
50
    {
51
        return $this->read_only;
52
    }
53
54
    /**
55
     * ID of shared folder that holds this folder.
56
     *
57
     * @return string
58
     */
59
    public function getParentSharedFolderId()
60
    {
61
        return $this->parent_shared_folder_id;
62
    }
63
64
    /**
65
     * ID of shared folder.
66
     *
67
     * @return string
68
     */
69
    public function getSharedFolderId()
70
    {
71
        return $this->shared_folder_id;
72
    }
73
}
74