PHP 클래스 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.
저자: Michael J. Rubinsky ([email protected])
상속: extends Horde_Registry_Api
파일 보기 프로젝트 열기: horde/horde

공개 메소드들

메소드 설명
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

메소드 상세

commentCallback() 공개 메소드

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

getTagIds() 공개 메소드

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

hasComments() 공개 메소드

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

listFeeds() 공개 메소드

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

listTagInfo() 공개 메소드

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.
리턴 array An array containing tag_name, and total

publish() 공개 메소드

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() 공개 메소드

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?
리턴 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() 공개 메소드

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.
리턴 array An array of story information

story() 공개 메소드

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.
리턴 array An array of story data

storyCount() 공개 메소드

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