Source for file note.php

Documentation is available at note.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 Note class for the Joomla Platform.
  16.  *
  17.  * @package     Joomla.Platform
  18.  * @subpackage  Facebook
  19.  *
  20.  * @see         http://developers.facebook.com/docs/reference/api/note/
  21.  * @since       13.1
  22.  */
  23. {
  24.     /**
  25.      * Method to get a note. Requires authentication and user_notes or friends_notes permission for non-public notes.
  26.      *
  27.      * @param   string  $note  The note 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 getNote($note)
  34.     {
  35.         return $this->get($note);
  36.     }
  37.  
  38.     /**
  39.      * Method to get a note's comments. Requires authentication and user_notes or friends_notes permission for non-public notes.
  40.      *
  41.      * @param   string   $note    The note 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($note$limit 0$offset 0$until null$since null)
  52.     {
  53.         return $this->getConnection($note'comments'''$limit$offset$until$since);
  54.     }
  55.  
  56.     /**
  57.      * Method to comment on a note. Requires authentication and publish_stream and user_notes or friends_notes permissions.
  58.      *
  59.      * @param   string  $note     The note 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($note$message)
  67.     {
  68.         // Set POST request parameters.
  69.         $data array();
  70.         $data['message'$message;
  71.  
  72.         return $this->createConnection($note'comments'$data);
  73.     }
  74.  
  75.     /**
  76.      * Method to delete a comment. Requires authentication and publish_stream and user_notes or friends_notes permissions.
  77.      *
  78.      * @param   string  $comment  The comment's id.
  79.      *
  80.      * @return  boolean Returns true if successful, and false otherwise.
  81.      *
  82.      * @since   13.1
  83.      */
  84.     public function deleteComment($comment)
  85.     {
  86.         return $this->deleteConnection($comment);
  87.     }
  88.  
  89.     /**
  90.      * Method to get note's likes. Requires authentication and user_notes or friends_notes for non-public notes.
  91.      *
  92.      * @param   string   $note    The note 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($note$limit 0$offset 0$until null$since null)
  103.     {
  104.         return $this->getConnection($note'likes'''$limit$offset$until$since);
  105.     }
  106.  
  107.     /**
  108.      * Method to like a note. Requires authentication and publish_stream and user_notes or friends_notes permissions.
  109.      *
  110.      * @param   string  $note  The note id.
  111.      *
  112.      * @return  boolean Returns true if successful, and false otherwise.
  113.      *
  114.      * @since   13.1
  115.      */
  116.     public function createLike($note)
  117.     {
  118.         return $this->createConnection($note'likes');
  119.     }
  120.  
  121.     /**
  122.      * Method to unlike a note. Requires authentication and publish_stream and user_notes or friends_notes permissions.
  123.      *
  124.      * @param   string  $note  The note id.
  125.      *
  126.      * @return  boolean Returns true if successful, and false otherwise.
  127.      *
  128.      * @since   13.1
  129.      */
  130.     public function deleteLike($note)
  131.     {
  132.         return $this->deleteConnection($note'likes');
  133.     }
  134. }

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