1 | <?php |
||
31 | class GraphUser extends GraphNode |
||
32 | { |
||
33 | /** |
||
34 | * @var array Maps object key names to Graph object types. |
||
35 | */ |
||
36 | protected static $graphObjectMap = [ |
||
37 | 'hometown' => '\Facebook\GraphNodes\GraphPage', |
||
38 | 'location' => '\Facebook\GraphNodes\GraphPage', |
||
39 | 'significant_other' => '\Facebook\GraphNodes\GraphUser', |
||
40 | 'picture' => '\Facebook\GraphNodes\GraphPicture', |
||
41 | ]; |
||
42 | |||
43 | /** |
||
44 | * Returns the ID for the user as a string if present. |
||
45 | * |
||
46 | * @return string|null |
||
47 | */ |
||
48 | public function getId() |
||
49 | { |
||
50 | return $this->getField('id'); |
||
51 | } |
||
52 | |||
53 | /** |
||
54 | * Returns the name for the user as a string if present. |
||
55 | * |
||
56 | * @return string|null |
||
57 | */ |
||
58 | public function getName() |
||
59 | { |
||
60 | return $this->getField('name'); |
||
61 | } |
||
62 | |||
63 | /** |
||
64 | * Returns the first name for the user as a string if present. |
||
65 | * |
||
66 | * @return string|null |
||
67 | */ |
||
68 | public function getFirstName() |
||
69 | { |
||
70 | return $this->getField('first_name'); |
||
71 | } |
||
72 | |||
73 | /** |
||
74 | * Returns the middle name for the user as a string if present. |
||
75 | * |
||
76 | * @return string|null |
||
77 | */ |
||
78 | public function getMiddleName() |
||
79 | { |
||
80 | return $this->getField('middle_name'); |
||
81 | } |
||
82 | |||
83 | /** |
||
84 | * Returns the last name for the user as a string if present. |
||
85 | * |
||
86 | * @return string|null |
||
87 | */ |
||
88 | public function getLastName() |
||
89 | { |
||
90 | return $this->getField('last_name'); |
||
91 | } |
||
92 | |||
93 | /** |
||
94 | * Returns the email for the user as a string if present. |
||
95 | * |
||
96 | * @return string|null |
||
97 | */ |
||
98 | public function getEmail() |
||
102 | |||
103 | /** |
||
104 | * Returns the gender for the user as a string if present. |
||
105 | * |
||
106 | * @return string|null |
||
107 | */ |
||
108 | public function getGender() |
||
112 | |||
113 | /** |
||
114 | * Returns the Facebook URL for the user as a string if available. |
||
115 | * |
||
116 | * @return string|null |
||
117 | */ |
||
118 | public function getLink() |
||
122 | |||
123 | /** |
||
124 | * Returns the users birthday, if available. |
||
125 | * |
||
126 | * @return \DateTime|null |
||
127 | */ |
||
128 | public function getBirthday() |
||
132 | |||
133 | /** |
||
134 | * Returns the current location of the user as a GraphPage. |
||
135 | * |
||
136 | * @return GraphPage|null |
||
137 | */ |
||
138 | public function getLocation() |
||
142 | |||
143 | /** |
||
144 | * Returns the current location of the user as a GraphPage. |
||
145 | * |
||
146 | * @return GraphPage|null |
||
147 | */ |
||
148 | public function getHometown() |
||
152 | |||
153 | /** |
||
154 | * Returns the current location of the user as a GraphUser. |
||
155 | * |
||
156 | * @return GraphUser|null |
||
157 | */ |
||
158 | public function getSignificantOther() |
||
162 | |||
163 | /** |
||
164 | * Returns the picture of the user as a GraphPicture |
||
165 | * |
||
166 | * @return GraphPicture|null |
||
167 | */ |
||
168 | public function getPicture() |
||
172 | } |
||
173 |