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