GraphPage::getName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Copyright 2016 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
 */
24
namespace Facebook\GraphNodes;
25
26
/**
27
 * Class GraphPage
28
 *
29
 * @package Facebook
30
 */
31
class GraphPage extends GraphNode
32
{
33
    /**
34
     * @var array Maps object key names to Graph object types.
35
     */
36
    protected static $graphObjectMap = [
37
        'best_page' => '\Facebook\GraphNodes\GraphPage',
38
        'global_brand_parent_page' => '\Facebook\GraphNodes\GraphPage',
39
        'location' => '\Facebook\GraphNodes\GraphLocation',
40
    ];
41
42
    /**
43
     * Returns the ID for the user's page as a string if present.
44
     *
45
     * @return string|null
46
     */
47
    public function getId()
48
    {
49
        return $this->getField('id');
50
    }
51
52
    /**
53
     * Returns the Category for the user's page as a string if present.
54
     *
55
     * @return string|null
56
     */
57
    public function getCategory()
58
    {
59
        return $this->getField('category');
60
    }
61
62
    /**
63
     * Returns the Name of the user's page as a string if present.
64
     *
65
     * @return string|null
66
     */
67
    public function getName()
68
    {
69
        return $this->getField('name');
70
    }
71
72
    /**
73
     * Returns the best available Page on Facebook.
74
     *
75
     * @return GraphPage|null
76
     */
77
    public function getBestPage()
78
    {
79
        return $this->getField('best_page');
80
    }
81
82
    /**
83
     * Returns the brand's global (parent) Page.
84
     *
85
     * @return GraphPage|null
86
     */
87
    public function getGlobalBrandParentPage()
88
    {
89
        return $this->getField('global_brand_parent_page');
90
    }
91
92
    /**
93
     * Returns the location of this place.
94
     *
95
     * @return GraphLocation|null
96
     */
97
    public function getLocation()
98
    {
99
        return $this->getField('location');
100
    }
101
102
    /**
103
     * Returns the page access token for the admin user.
104
     *
105
     * Only available in the `/me/accounts` context.
106
     *
107
     * @return string|null
108
     */
109
    public function getAccessToken()
110
    {
111
        return $this->getField('access_token');
112
    }
113
114
    /**
115
     * Returns the roles of the page admin user.
116
     *
117
     * Only available in the `/me/accounts` context.
118
     *
119
     * @return array|null
120
     */
121
    public function getPerms()
122
    {
123
        return $this->getField('perms');
124
    }
125
}
126