Skip to content
This repository was archived by the owner on Jan 13, 2022. It is now read-only.

Commit 5733f55

Browse files
author
Fosco Marotto
committed
Merge pull request #102 from arturluizbr/master
Adding GraphObjects to handle /user-id/accounts
2 parents 3372704 + 81597f9 commit 5733f55

File tree

2 files changed

+148
-0
lines changed

2 files changed

+148
-0
lines changed

src/Facebook/GraphPage.php

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<?php
2+
/**
3+
* Copyright 2014 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;
25+
26+
/**
27+
* Class GraphPage
28+
* @package Facebook
29+
* @author Artur Luiz <[email protected]>
30+
*/
31+
class GraphPage extends GraphObject
32+
{
33+
34+
/**
35+
* Returns the ID for the user's page as a string if present.
36+
*
37+
* @return string|null
38+
*/
39+
public function getId()
40+
{
41+
return $this->getProperty('id');
42+
}
43+
44+
/**
45+
* Returns the Category for the user's page as a string if present.
46+
*
47+
* @return string|null
48+
*/
49+
public function getCategory()
50+
{
51+
return $this->getProperty('category');
52+
}
53+
54+
/**
55+
* Returns the Name of the user's page as a string if present.
56+
*
57+
* @return string|null
58+
*/
59+
public function getName()
60+
{
61+
return $this->getProperty('name');
62+
}
63+
64+
}

src/Facebook/GraphUserPage.php

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
<?php
2+
/**
3+
* Copyright 2014 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;
25+
26+
/**
27+
* Class GraphUserPage
28+
* @package Facebook
29+
* @author Artur Luiz <[email protected]>
30+
*/
31+
class GraphUserPage extends GraphObject
32+
{
33+
34+
/**
35+
* Returns the ID for the user's page as a string if present.
36+
*
37+
* @return string|null
38+
*/
39+
public function getId()
40+
{
41+
return $this->getProperty('id');
42+
}
43+
44+
/**
45+
* Returns the Category for the user's page as a string if present.
46+
*
47+
* @return string|null
48+
*/
49+
public function getCategory()
50+
{
51+
return $this->getProperty('category');
52+
}
53+
54+
/**
55+
* Returns the Name of the user's page as a string if present.
56+
*
57+
* @return string|null
58+
*/
59+
public function getName()
60+
{
61+
return $this->getProperty('name');
62+
}
63+
64+
/**
65+
* Returns the Access Token used to access the user's page as a string if present.
66+
*
67+
* @return string|null
68+
*/
69+
public function getAccessToken()
70+
{
71+
return $this->getProperty('access_token');
72+
}
73+
74+
/**
75+
* Returns the Permissions for the user's page as an array if present.
76+
*
77+
* @return array|null
78+
*/
79+
public function getPermissions()
80+
{
81+
return $this->getProperty('perms');
82+
}
83+
84+
}

0 commit comments

Comments
 (0)