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
Показать файл Открыть проект

Открытые методы

Метод Описание
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