Joomla Platform  13.1
Documentation des API du framework Joomla Platform
 Tout Classes Espaces de nommage Fichiers Fonctions Variables Pages
video.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 Video class for the Joomla Platform.
16  *
17  * @package Joomla.Platform
18  * @subpackage Facebook
19  *
20  * @see http://developers.facebook.com/docs/reference/api/video/
21  * @since 13.1
22  */
24 {
25  /**
26  * Method to get a video. Requires authentication and user_videos or friends_videos permission for private videos.
27  *
28  * @param string $video The video 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 getVideo($video)
35  {
36  return $this->get($video);
37  }
38 
39  /**
40  * Method to get a video's comments. Requires authentication and user_videos or friends_videos permission for private videos.
41  *
42  * @param string $video The video 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($video, $limit=0, $offset=0, $until=null, $since=null)
53  {
54  return $this->getConnection($video, 'comments', '', $limit, $offset, $until, $since);
55  }
56 
57  /**
58  * Method to comment on a video. Requires authentication and publish_stream permission, user_videos or friends_videos permission for private videos.
59  *
60  * @param string $video The video 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($video, $message)
68  {
69  // Set POST request parameters.
70  $data = array();
71  $data['message'] = $message;
72 
73  return $this->createConnection($video, 'comments', $data);
74  }
75 
76  /**
77  * Method to delete a comment. Requires authentication and publish_stream permission, user_videos or friends_videos permission for private videos.
78  *
79  * @param string $comment The comment's id.
80  *
81  * @return boolean Returns true if successful, and false otherwise.
82  *
83  * @since 13.1
84  */
85  public function deleteComment($comment)
86  {
87  return $this->deleteConnection($comment);
88  }
89 
90  /**
91  * Method to get video's likes. Requires authentication and user_videos or friends_videos permission for private videos.
92  *
93  * @param string $video The video id.
94  * @param integer $limit The number of objects per page.
95  * @param integer $offset The object's number on the page.
96  * @param string $until A unix timestamp or any date accepted by strtotime.
97  * @param string $since A unix timestamp or any date accepted by strtotime.
98  *
99  * @return mixed The decoded JSON response or false if the client is not authenticated.
100  *
101  * @since 13.1
102  */
103  public function getLikes($video, $limit=0, $offset=0, $until=null, $since=null)
104  {
105  return $this->getConnection($video, 'likes', '', $limit, $offset, $until, $since);
106  }
107 
108  /**
109  * Method to like a video. Requires authentication and publish_stream permission, user_videos or friends_videos permission for private videos.
110  *
111  * @param string $video The video id.
112  *
113  * @return boolean Returns true if successful, and false otherwise.
114  *
115  * @since 13.1
116  */
117  public function createLike($video)
118  {
119  return $this->createConnection($video, 'likes');
120  }
121 
122  /**
123  * Method to unlike a video. Requires authentication and publish_stream permission, user_videos or friends_videos permission for private videos.
124  *
125  * @param string $video The video id.
126  *
127  * @return boolean Returns true if successful, and false otherwise.
128  *
129  * @since 13.1
130  */
131  public function deleteLike($video)
132  {
133  return $this->deleteConnection($video, 'likes');
134  }
135 
136  /**
137  * Method to get the album-sized view of the video. Requires authentication and user_videos or friends_videos permission for private photos.
138  *
139  * @param string $video The video id.
140  *
141  * @return string URL of the picture.
142  *
143  * @since 13.1
144  */
145  public function getPicture($video)
146  {
147  return $this->getConnection($video, 'picture');
148  }
149 }