Source for file link.php

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

Documentation generated on Tue, 19 Nov 2013 15:07:09 +0100 by phpDocumentor 1.4.3