1 <?php
2 /**
3 * @package Joomla.Platform
4 * @subpackage Facebook
5 *
6 * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
7 * @license GNU General Public License version 2 or later; see LICENSE
8 */
9
10 defined('JPATH_PLATFORM') or die();
11
12 /**
13 * Facebook API Checkin class for the Joomla Platform.
14 *
15 * @link http://developers.facebook.com/docs/reference/api/checkin/
16 * @since 13.1
17 * @deprecated 4.0 Use the `joomla/facebook` package via Composer instead
18 */
19 class JFacebookCheckin extends JFacebookObject
20 {
21 /**
22 * Method to get a checkin. Requires authentication and user_checkins or friends_checkins permission.
23 *
24 * @param string $checkin The checkin id.
25 *
26 * @return mixed The decoded JSON response or false if the client is not authenticated.
27 *
28 * @since 13.1
29 */
30 public function getCheckin($checkin)
31 {
32 return $this->get($checkin);
33 }
34
35 /**
36 * Method to get a checkin's comments. Requires authentication and user_checkins or friends_checkins permission.
37 *
38 * @param string $checkin The checkin id.
39 * @param integer $limit The number of objects per page.
40 * @param integer $offset The object's number on the page.
41 * @param string $until A unix timestamp or any date accepted by strtotime.
42 * @param string $since A unix timestamp or any date accepted by strtotime.
43 *
44 * @return mixed The decoded JSON response or false if the client is not authenticated.
45 *
46 * @since 13.1
47 */
48 public function getComments($checkin, $limit=0, $offset=0, $until=null, $since=null)
49 {
50 return $this->getConnection($checkin, 'comments', '', $limit, $offset, $until, $since);
51 }
52
53 /**
54 * Method to post a comment to the checkin. Requires authentication and publish_stream and user_checkins or friends_checkins permission.
55 *
56 * @param string $checkin The checkin id.
57 * @param string $message The checkin's text.
58 *
59 * @return mixed The decoded JSON response or false if the client is not authenticated.
60 *
61 * @since 13.1
62 */
63 public function createComment($checkin, $message)
64 {
65 // Set POST request parameters.
66 $data = array();
67 $data['message'] = $message;
68
69 return $this->createConnection($checkin, 'comments', $data);
70 }
71
72 /**
73 * Method to delete a comment. Requires authentication and publish_stream permission.
74 *
75 * @param string $comment The comment's id.
76 *
77 * @return mixed The decoded JSON response or false if the client is not authenticated.
78 *
79 * @since 13.1
80 */
81 public function deleteComment($comment)
82 {
83 return $this->deleteConnection($comment);
84 }
85
86 /**
87 * Method to get a checkin's likes. Requires authentication and user_checkins or friends_checkins permission.
88 *
89 * @param string $checkin The checkin id.
90 * @param integer $limit The number of objects per page.
91 * @param integer $offset The object's number on the page.
92 * @param string $until A unix timestamp or any date accepted by strtotime.
93 * @param string $since A unix timestamp or any date accepted by strtotime.
94 *
95 * @return mixed The decoded JSON response or false if the client is not authenticated.
96 *
97 * @since 13.1
98 */
99 public function getLikes($checkin, $limit=0, $offset=0, $until=null, $since=null)
100 {
101 return $this->getConnection($checkin, 'likes', '', $limit, $offset, $until, $since);
102 }
103
104 /**
105 * Method to like a checkin. Requires authentication and publish_stream and user_checkins or friends_checkins permission.
106 *
107 * @param string $checkin The checkin id.
108 *
109 * @return mixed The decoded JSON response or false if the client is not authenticated.
110 *
111 * @since 13.1
112 */
113 public function createLike($checkin)
114 {
115 return $this->createConnection($checkin, 'likes');
116 }
117
118 /**
119 * Method to unlike a checkin. Requires authentication and publish_stream permission.
120 *
121 * @param string $checkin The checkin id.
122 *
123 * @return mixed The decoded JSON response or false if the client is not authenticated.
124 *
125 * @since 13.1
126 */
127 public function deleteLike($checkin)
128 {
129 return $this->deleteConnection($checkin, 'likes');
130 }
131 }
132