GraphAlbum   A
last analyzed

Complexity

Total Complexity 14

Size/Duplication

Total Lines 150
Duplicated Lines 0 %

Test Coverage

Coverage 28.57%

Importance

Changes 0
Metric Value
dl 0
loc 150
rs 10
c 0
b 0
f 0
ccs 8
cts 28
cp 0.2857
wmc 14

14 Methods

Rating   Name   Duplication   Size   Complexity  
A getId() 0 3 1
A getPrivacy() 0 3 1
A getFrom() 0 3 1
A getCoverPhoto() 0 3 1
A getCount() 0 3 1
A getCanUpload() 0 3 1
A getPlace() 0 3 1
A getType() 0 3 1
A getLocation() 0 3 1
A getCreatedTime() 0 3 1
A getDescription() 0 3 1
A getUpdatedTime() 0 3 1
A getLink() 0 3 1
A getName() 0 3 1
1
<?php
2
/**
3
 * Copyright 2017 Facebook, Inc.
4
 *
5
 * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
 * use, copy, modify, and distribute this software in source code or binary
7
 * form for use in connection with the web services and APIs provided by
8
 * Facebook.
9
 *
10
 * As with any software that integrates with the Facebook platform, your use
11
 * of this software is subject to the Facebook Developer Principles and
12
 * Policies [http://developers.facebook.com/policy/]. This copyright notice
13
 * shall be included in all copies or substantial portions of the software.
14
 *
15
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21
 * DEALINGS IN THE SOFTWARE.
22
 */
23
namespace Facebook\GraphNode;
24
25
/**
26
 * @package Facebook
27
 */
28
29
class GraphAlbum extends GraphNode
30
{
31
    /**
32
     * @var array maps object key names to Graph object types
33
     */
34
    protected static $graphNodeMap = [
35
        'from' => GraphUser::class,
36
        'place' => GraphPage::class,
37
    ];
38
39
    /**
40
     * Returns the ID for the album.
41
     *
42
     * @return null|string
43
     */
44
    public function getId()
45
    {
46
        return $this->getField('id');
47
    }
48
49
    /**
50
     * Returns whether the viewer can upload photos to this album.
51
     *
52
     * @return null|bool
53
     */
54
    public function getCanUpload()
55
    {
56
        return $this->getField('can_upload');
57
    }
58
59
    /**
60
     * Returns the number of photos in this album.
61
     *
62
     * @return null|int
63
     */
64
    public function getCount()
65
    {
66
        return $this->getField('count');
67
    }
68
69
    /**
70
     * Returns the ID of the album's cover photo.
71
     *
72
     * @return null|string
73
     */
74
    public function getCoverPhoto()
75
    {
76
        return $this->getField('cover_photo');
77
    }
78
79
    /**
80
     * Returns the time the album was initially created.
81
     *
82
     * @return null|\DateTime
83
     */
84 1
    public function getCreatedTime()
85
    {
86 1
        return $this->getField('created_time');
87
    }
88
89
    /**
90
     * Returns the time the album was updated.
91
     *
92
     * @return null|\DateTime
93
     */
94 1
    public function getUpdatedTime()
95
    {
96 1
        return $this->getField('updated_time');
97
    }
98
99
    /**
100
     * Returns the description of the album.
101
     *
102
     * @return null|string
103
     */
104
    public function getDescription()
105
    {
106
        return $this->getField('description');
107
    }
108
109
    /**
110
     * Returns profile that created the album.
111
     *
112
     * @return null|GraphUser
113
     */
114 1
    public function getFrom()
115
    {
116 1
        return $this->getField('from');
117
    }
118
119
    /**
120
     * Returns profile that created the album.
121
     *
122
     * @return null|GraphPage
123
     */
124 1
    public function getPlace()
125
    {
126 1
        return $this->getField('place');
127
    }
128
129
    /**
130
     * Returns a link to this album on Facebook.
131
     *
132
     * @return null|string
133
     */
134
    public function getLink()
135
    {
136
        return $this->getField('link');
137
    }
138
139
    /**
140
     * Returns the textual location of the album.
141
     *
142
     * @return null|string
143
     */
144
    public function getLocation()
145
    {
146
        return $this->getField('location');
147
    }
148
149
    /**
150
     * Returns the title of the album.
151
     *
152
     * @return null|string
153
     */
154
    public function getName()
155
    {
156
        return $this->getField('name');
157
    }
158
159
    /**
160
     * Returns the privacy settings for the album.
161
     *
162
     * @return null|string
163
     */
164
    public function getPrivacy()
165
    {
166
        return $this->getField('privacy');
167
    }
168
169
    /**
170
     * Returns the type of the album.
171
     *
172
     * enum{ profile, mobile, wall, normal, album }
173
     *
174
     * @return null|string
175
     */
176
    public function getType()
177
    {
178
        return $this->getField('type');
179
    }
180
}
181