Source for file post.php

Documentation is available at post.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 Post class for the Joomla Platform.
  16.  *
  17.  * @package     Joomla.Platform
  18.  * @subpackage  Facebook
  19.  *
  20.  * @see         http://developers.facebook.com/docs/reference/api/post/
  21.  * @since       13.1
  22.  */
  23. {
  24.     /**
  25.      * Method to get a post. Requires authentication and read_stream permission for all data.
  26.      *
  27.      * @param   string  $post  The post 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 getPost($post)
  34.     {
  35.         return $this->get($post);
  36.     }
  37.  
  38.     /**
  39.      * Method to delete a post if it was created by this application. Requires authentication and publish_stream permission
  40.      *
  41.      * @param   string  $post  The post id.
  42.      *
  43.      * @return  boolean Returns true if successful, and false otherwise.
  44.      *
  45.      * @since   13.1
  46.      */
  47.     public function deletePost($post)
  48.     {
  49.         return $this->deleteConnection($post);
  50.     }
  51.  
  52.     /**
  53.      * Method to get a post's comments. Requires authentication and read_stream permission.
  54.      *
  55.      * @param   string   $post    The post 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($post$limit 0$offset 0$until null$since null)
  66.     {
  67.         return $this->getConnection($post'comments'''$limit$offset$until$since);
  68.     }
  69.  
  70.     /**
  71.      * Method to comment on a post. Requires authentication and publish_stream permission
  72.      *
  73.      * @param   string  $post     The post 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($post$message)
  81.     {
  82.         // Set POST request parameters.
  83.         $data['message'$message;
  84.  
  85.         return $this->createConnection($post'comments'$data);
  86.     }
  87.  
  88.     /**
  89.      * Method to delete a comment. Requires authentication and publish_stream permission
  90.      *
  91.      * @param   string  $comment  The comment's id.
  92.      *
  93.      * @return  boolean Returns true if successful, and false otherwise.
  94.      *
  95.      * @since   13.1
  96.      */
  97.     public function deleteComment($comment)
  98.     {
  99.         return $this->deleteConnection($comment);
  100.     }
  101.  
  102.     /**
  103.      * Method to get post's likes. Requires authentication and read_stream permission.
  104.      *
  105.      * @param   string   $post    The post id.
  106.      * @param   integer  $limit   The number of objects per page.
  107.      * @param   integer  $offset  The object's number on the page.
  108.      * @param   string   $until   A unix timestamp or any date accepted by strtotime.
  109.      * @param   string   $since   A unix timestamp or any date accepted by strtotime.
  110.      *
  111.      * @return  mixed   The decoded JSON response or false if the client is not authenticated.
  112.      *
  113.      * @since   13.1
  114.      */
  115.     public function getLikes($post$limit 0$offset 0$until null$since null)
  116.     {
  117.         return $this->getConnection($post'likes'''$limit$offset$until$since);
  118.     }
  119.  
  120.     /**
  121.      * Method to like a post. Requires authentication and publish_stream permission
  122.      *
  123.      * @param   string  $post  The post id.
  124.      *
  125.      * @return  boolean Returns true if successful, and false otherwise.
  126.      *
  127.      * @since   13.1
  128.      */
  129.     public function createLike($post)
  130.     {
  131.         return $this->createConnection($post'likes');
  132.     }
  133.  
  134.     /**
  135.      * Method to unlike a post. Requires authentication and publish_stream permission
  136.      *
  137.      * @param   string  $post  The post id.
  138.      *
  139.      * @return  boolean Returns true if successful, and false otherwise.
  140.      *
  141.      * @since   13.1
  142.      */
  143.     public function deleteLike($post)
  144.     {
  145.         return $this->deleteConnection($post'likes');
  146.     }
  147. }

Documentation generated on Tue, 19 Nov 2013 15:11:00 +0100 by phpDocumentor 1.4.3