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 Status class for the Joomla Platform.
14 *
15 * @link http://developers.facebook.com/docs/reference/api/status/
16 * @since 13.1
17 * @deprecated 4.0 Use the `joomla/facebook` package via Composer instead
18 */
19 class JFacebookStatus extends JFacebookObject
20 {
21 /**
22 * Method to get a status message. Requires authentication.
23 *
24 * @param string $status The status message 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 getStatus($status)
31 {
32 return $this->get($status);
33 }
34
35 /**
36 * Method to get a status message's comments. Requires authentication.
37 *
38 * @param string $status The status message 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($status, $limit = 0, $offset = 0, $until = null, $since = null)
49 {
50 return $this->getConnection($status, 'comments', '', $limit, $offset, $until, $since);
51 }
52
53 /**
54 * Method to post a comment to the status message. Requires authentication and publish_stream and user_status or friends_status permission.
55 *
56 * @param string $status The status message id.
57 * @param string $message The comment'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($status, $message)
64 {
65 // Set POST request parameters.
66 $data['message'] = $message;
67
68 return $this->createConnection($status, 'comments', $data);
69 }
70
71 /**
72 * Method to delete a comment. Requires authentication and publish_stream and user_status or friends_status permission.
73 *
74 * @param string $comment The comment's id.
75 *
76 * @return mixed The decoded JSON response or false if the client is not authenticated.
77 *
78 * @since 13.1
79 */
80 public function deleteComment($comment)
81 {
82 return $this->deleteConnection($comment);
83 }
84
85 /**
86 * Method to get a status message's likes. Requires authentication.
87 *
88 * @param string $status The status message id.
89 * @param integer $limit The number of objects per page.
90 * @param integer $offset The object's number on the page.
91 * @param string $until A unix timestamp or any date accepted by strtotime.
92 * @param string $since A unix timestamp or any date accepted by strtotime.
93 *
94 * @return mixed The decoded JSON response or false if the client is not authenticated.
95 *
96 * @since 13.1
97 */
98 public function getLikes($status, $limit = 0, $offset = 0, $until = null, $since = null)
99 {
100 return $this->getConnection($status, 'likes', '', $limit, $offset, $until, $since);
101 }
102
103 /**
104 * Method to like status message. Requires authentication and publish_stream and user_status or friends_status permission.
105 *
106 * @param string $status The status message id.
107 *
108 * @return mixed The decoded JSON response or false if the client is not authenticated.
109 *
110 * @since 13.1
111 */
112 public function createLike($status)
113 {
114 return $this->createConnection($status, 'likes');
115 }
116
117 /**
118 * Method to unlike a status message. Requires authentication and publish_stream and user_status or friends_status permission.
119 *
120 * @param string $status The status message id.
121 *
122 * @return mixed The decoded JSON response or false if the client is not authenticated.
123 *
124 * @since 13.1
125 */
126 public function deleteLike($status)
127 {
128 return $this->deleteConnection($status, 'likes');
129 }
130 }
131