GraphEvent.php 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  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. */
  24. namespace Facebook\GraphNodes;
  25. /**
  26. * Class GraphEvent
  27. *
  28. * @package Facebook
  29. */
  30. class GraphEvent extends GraphNode
  31. {
  32. /**
  33. * @var array Maps object key names to GraphNode types.
  34. */
  35. protected static $graphObjectMap = [
  36. 'cover' => '\Facebook\GraphNodes\GraphCoverPhoto',
  37. 'place' => '\Facebook\GraphNodes\GraphPage',
  38. 'picture' => '\Facebook\GraphNodes\GraphPicture',
  39. 'parent_group' => '\Facebook\GraphNodes\GraphGroup',
  40. ];
  41. /**
  42. * Returns the `id` (The event ID) as string if present.
  43. *
  44. * @return string|null
  45. */
  46. public function getId()
  47. {
  48. return $this->getField('id');
  49. }
  50. /**
  51. * Returns the `cover` (Cover picture) as GraphCoverPhoto if present.
  52. *
  53. * @return GraphCoverPhoto|null
  54. */
  55. public function getCover()
  56. {
  57. return $this->getField('cover');
  58. }
  59. /**
  60. * Returns the `description` (Long-form description) as string if present.
  61. *
  62. * @return string|null
  63. */
  64. public function getDescription()
  65. {
  66. return $this->getField('description');
  67. }
  68. /**
  69. * Returns the `end_time` (End time, if one has been set) as DateTime if present.
  70. *
  71. * @return \DateTime|null
  72. */
  73. public function getEndTime()
  74. {
  75. return $this->getField('end_time');
  76. }
  77. /**
  78. * Returns the `is_date_only` (Whether the event only has a date specified, but no time) as bool if present.
  79. *
  80. * @return bool|null
  81. */
  82. public function getIsDateOnly()
  83. {
  84. return $this->getField('is_date_only');
  85. }
  86. /**
  87. * Returns the `name` (Event name) as string if present.
  88. *
  89. * @return string|null
  90. */
  91. public function getName()
  92. {
  93. return $this->getField('name');
  94. }
  95. /**
  96. * Returns the `owner` (The profile that created the event) as GraphNode if present.
  97. *
  98. * @return GraphNode|null
  99. */
  100. public function getOwner()
  101. {
  102. return $this->getField('owner');
  103. }
  104. /**
  105. * Returns the `parent_group` (The group the event belongs to) as GraphGroup if present.
  106. *
  107. * @return GraphGroup|null
  108. */
  109. public function getParentGroup()
  110. {
  111. return $this->getField('parent_group');
  112. }
  113. /**
  114. * Returns the `place` (Event Place information) as GraphPage if present.
  115. *
  116. * @return GraphPage|null
  117. */
  118. public function getPlace()
  119. {
  120. return $this->getField('place');
  121. }
  122. /**
  123. * Returns the `privacy` (Who can see the event) as string if present.
  124. *
  125. * @return string|null
  126. */
  127. public function getPrivacy()
  128. {
  129. return $this->getField('privacy');
  130. }
  131. /**
  132. * Returns the `start_time` (Start time) as DateTime if present.
  133. *
  134. * @return \DateTime|null
  135. */
  136. public function getStartTime()
  137. {
  138. return $this->getField('start_time');
  139. }
  140. /**
  141. * Returns the `ticket_uri` (The link users can visit to buy a ticket to this event) as string if present.
  142. *
  143. * @return string|null
  144. */
  145. public function getTicketUri()
  146. {
  147. return $this->getField('ticket_uri');
  148. }
  149. /**
  150. * Returns the `timezone` (Timezone) as string if present.
  151. *
  152. * @return string|null
  153. */
  154. public function getTimezone()
  155. {
  156. return $this->getField('timezone');
  157. }
  158. /**
  159. * Returns the `updated_time` (Last update time) as DateTime if present.
  160. *
  161. * @return \DateTime|null
  162. */
  163. public function getUpdatedTime()
  164. {
  165. return $this->getField('updated_time');
  166. }
  167. /**
  168. * Returns the `picture` (Event picture) as GraphPicture if present.
  169. *
  170. * @return GraphPicture|null
  171. */
  172. public function getPicture()
  173. {
  174. return $this->getField('picture');
  175. }
  176. /**
  177. * Returns the `attending_count` (Number of people attending the event) as int if present.
  178. *
  179. * @return int|null
  180. */
  181. public function getAttendingCount()
  182. {
  183. return $this->getField('attending_count');
  184. }
  185. /**
  186. * Returns the `declined_count` (Number of people who declined the event) as int if present.
  187. *
  188. * @return int|null
  189. */
  190. public function getDeclinedCount()
  191. {
  192. return $this->getField('declined_count');
  193. }
  194. /**
  195. * Returns the `maybe_count` (Number of people who maybe going to the event) as int if present.
  196. *
  197. * @return int|null
  198. */
  199. public function getMaybeCount()
  200. {
  201. return $this->getField('maybe_count');
  202. }
  203. /**
  204. * Returns the `noreply_count` (Number of people who did not reply to the event) as int if present.
  205. *
  206. * @return int|null
  207. */
  208. public function getNoreplyCount()
  209. {
  210. return $this->getField('noreply_count');
  211. }
  212. /**
  213. * Returns the `invited_count` (Number of people invited to the event) as int if present.
  214. *
  215. * @return int|null
  216. */
  217. public function getInvitedCount()
  218. {
  219. return $this->getField('invited_count');
  220. }
  221. }