Source for file comment.php

Documentation is available at comment.php

  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 Comment class for the Joomla Platform.
  16.  *
  17.  * @package     Joomla.Platform
  18.  * @subpackage  Facebook
  19.  *
  20.  * @see         http://developers.facebook.com/docs/reference/api/Comment/
  21.  * @since       13.1
  22.  */
  23. {
  24.     /**
  25.      * Method to get a comment. Requires authentication.
  26.      *
  27.      * @param   string  $comment  The comment id.
  28.      *
  29.      * @return  mixed   The decoded JSON response or false if the client is not authenticated.
  30.      *
  31.      * @since   13.1
  32.      */
  33.     public function getComment($comment)
  34.     {
  35.         return $this->get($comment);
  36.     }
  37.  
  38.     /**
  39.      * Method to delete a comment. Requires authentication and publish_stream permission.
  40.      *
  41.      * @param   string  $comment  The comment id.
  42.      *
  43.      * @return  boolean Returns true if successful, and false otherwise.
  44.      *
  45.      * @since   13.1
  46.      */
  47.     public function deleteComment($comment)
  48.     {
  49.         return $this->deleteConnection($comment);
  50.     }
  51.  
  52.     /**
  53.      * Method to get a comment's comments. Requires authentication.
  54.      *
  55.      * @param   string   $comment  The comment id.
  56.      * @param   integer  $limit    The number of objects per page.
  57.      * @param   integer  $offset   The object's number on the page.
  58.      * @param   string   $until    A unix timestamp or any date accepted by strtotime.
  59.      * @param   string   $since    A unix timestamp or any date accepted by strtotime.
  60.      *
  61.      * @return  mixed   The decoded JSON response or false if the client is not authenticated.
  62.      *
  63.      * @since   13.1
  64.      */
  65.     public function getComments($comment$limit=0$offset=0$until=null$since=null)
  66.     {
  67.         return $this->getConnection($comment'comments'''$limit$offset$until$since);
  68.     }
  69.  
  70.     /**
  71.      * Method to comment on a comment. Requires authentication with publish_stream permission.
  72.      *
  73.      * @param   string  $comment  The comment id.
  74.      * @param   string  $message  The comment's text.
  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 createComment($comment$message)
  81.     {
  82.         // Set POST request parameters.
  83.         $data array();
  84.         $data['message'$message;
  85.  
  86.         return $this->createConnection($comment'comments'$data);
  87.     }
  88.  
  89.     /**
  90.      * Method to get comment's likes. Requires authentication.
  91.      *
  92.      * @param   string   $comment  The comment 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($comment$limit=0$offset=0$until=null$since=null)
  103.     {
  104.         return $this->getConnection($comment'likes'''$limit$offset$until$since);
  105.     }
  106.  
  107.     /**
  108.      * Method to like a comment. Requires authentication and publish_stram permission.
  109.      *
  110.      * @param   string  $comment  The comment id.
  111.      *
  112.      * @return  boolean Returns true if successful, and false otherwise.
  113.      *
  114.      * @since   13.1
  115.      */
  116.     public function createLike($comment)
  117.     {
  118.         return $this->createConnection($comment'likes');
  119.     }
  120.  
  121.     /**
  122.      * Method to unlike a comment. Requires authentication and publish_stram permission.
  123.      *
  124.      * @param   string  $comment  The comment id.
  125.      *
  126.      * @return  boolean Returns true if successful, and false otherwise.
  127.      *
  128.      * @since   13.1
  129.      */
  130.     public function deleteLike($comment)
  131.     {
  132.         return $this->deleteConnection($comment'likes');
  133.     }
  134. }

Documentation generated on Tue, 19 Nov 2013 14:56:05 +0100 by phpDocumentor 1.4.3