PHP Class Jonah_Api, horde

This file defines Jonah's external API interface. Other applications can interact with Jonah through this API. Copyright 2002-2016 Horde LLC (http://www.horde.org/) See the enclosed file LICENSE for license information (BSD). If you did not did not receive this file, see http://cvs.horde.org/co.php/jonah/LICENSE.
Author: Michael J. Rubinsky ([email protected])
Inheritance: extends Horde_Registry_Api
ファイルを表示 Open project: horde/horde

Public Methods

Method Description
commentCallback ( $story_id ) : mixed Callback for comment API
getTagIds ( array $names ) : Array Return a set of tag_ids, given the tag name
hasComments ( ) : boolean Check if comments are allowed.
listFeeds ( ) : array Get a list of stored channels.
listTagInfo ( array $tags = [], array $channel_id = null ) : array Retrieve the list of used tag_names, tag_ids and the total number of resources that are linked to that tag.
publish ( integer $channel_id, array $story ) Publish a new story
searchTags ( array $names, array $filter = [], boolean $raw = false ) : An Searches internal channels for stories tagged with all requested tags.
stories ( integer $channel_id, array $filter = [] ) : array Return the requested stories
story ( integer $channel_id, integer $story_id, boolean $read = true ) : array Fetches a story from a requested channel.
storyCount ( integer $channel_id ) : mixed Get the count of stories in the specified channel

Method Details

commentCallback() public method

Callback for comment API
public commentCallback ( $story_id ) : mixed
return mixed Name of object on success | false on failure

getTagIds() public method

Return a set of tag_ids, given the tag name
public getTagIds ( array $names ) : Array
$names array An array of names to search for
return Array An array of tag_name => tag_ids

hasComments() public method

Check if comments are allowed.
public hasComments ( ) : boolean
return boolean

listFeeds() public method

Get a list of stored channels.
public listFeeds ( ) : array
return array An array of channels

listTagInfo() public method

Retrieve the list of used tag_names, tag_ids and the total number of resources that are linked to that tag.
public listTagInfo ( array $tags = [], array $channel_id = null ) : array
$tags array An optional array of tag_ids. If omitted, all tags will be included.@deprecated and currently ignored.
$channel_id array An optional array of channel_ids. @todo - only the first requested channel is honored.
return array An array containing tag_name, and total

publish() public method

Publish a new story
public publish ( integer $channel_id, array $story )
$channel_id integer The channel id
$story array The story array. Can contain:
 (string)title       [REQUIRED]    The story title.
 (string)description [REQUIRED]    The short description.
 (string)body_type   [OPTIONAL]    The body type (text/html).
 (string)body        [OPTIONAL]    The story body.
 (string)url         [OPTIONAL]    The url for the story link.
 (array)tags         [OPTIONAL]    Tags

searchTags() public method

Returns an application-agnostic array (useful for when doing a tag search across multiple applications). The 'raw' story array can be returned instead by setting $raw = true.
public searchTags ( array $names, array $filter = [], boolean $raw = false ) : An
$names array An array of tag_names to search for (AND'd together).
$filter array An array of optional filter parameters.
   max       The maximum number of stories to return.
   from      The number of the story to start with.
   channel_id  (integer) A channel_id to restrict to.
   order     How to order the results (a Jonah::ORDER_* constant)
$raw boolean Return the raw story data?
return An array of results with the following structure:
  'title'    - The title for this resource.
  'desc'     - A terse description of this resource.
  'view_url' - The URL to view this resource.
  'app'      - The Horde application this resource belongs to.

stories() public method

Return the requested stories
public stories ( integer $channel_id, array $filter = [] ) : array
$channel_id integer The channel to get the stories from.
$filter array Additional, optional filters.
  max_stories  The maximum number of stories to get.
  start_at     The story number to start retrieving.
  order        How to order the results.
return array An array of story information

story() public method

Fetches a story from a requested channel.
public story ( integer $channel_id, integer $story_id, boolean $read = true ) : array
$channel_id integer The channel id to fetch.
$story_id integer The story id to fetch.
$read boolean Whether to update the read count.
return array An array of story data

storyCount() public method

Get the count of stories in the specified channel
public storyCount ( integer $channel_id ) : mixed
$channel_id integer
return mixed The story count