PHP Класс Jonah_Driver, horde

Copyright 2002-2014 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.
Автор: Chuck Hagenbuch ([email protected])
Автор: Marko Djukic ([email protected])
Автор: Jan Schneider ([email protected])
Автор: Ben Klang ([email protected])
Автор: Michael J. Rubinsky ([email protected])
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$_params array Hash containing connection parameters.

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

Метод Описание
__construct ( array $params = [] ) Constructs a new Driver storage object.
deleteChannel ( array $info ) Remove a channel from storage.
getChannel ( integer $channel_id ) : array Fetches the requested channel, while actually passing on the request to the backend _getChannel() function to do the real work.
getChannels ( ) : array Get a list of stored channels.
getChecksum ( $story )
getIdBySlug ( $channel )
getIntervalLabel ( $seconds = null )
getStories ( integer $criteria, integer $order = Jonah::ORDER_PUBLISHED ) : array Returns the most recent or all stories from a channel.
getStory ( integer $story_id, boolean $read = false ) : array Retrieve the requested story from storage.
getStoryIdsByChannel ( integer $channel_id ) : array Return a list of story_ids contained in the specified channel.
getStoryLink ( array $channel, array $story ) : Horde_Url Returns the official link to a story.
listTagInfo ( $channel_id = null )
renderChannel ( integer $channel_id, string $tpl, integer $max = 10, integer $from, integer $order = Jonah::ORDER_PUBLISHED ) : string Returns the stories of a channel rendered with the specified template.
saveStory ( array &$info ) Save the provided story to storage.

Защищенные методы

Метод Описание
_escapeStories ( &$value, $key )
_escapeStoryDescriptions ( &$value, $key )
getStoryAsMessage ( array $story ) : MIME_Part Returns the provided story as a MIME part.

Описание методов

__construct() публичный Метод

Constructs a new Driver storage object.
public __construct ( array $params = [] )
$params array A hash containing connection parameters.

_escapeStories() защищенный Метод

protected _escapeStories ( &$value, $key )

_escapeStoryDescriptions() защищенный Метод

protected _escapeStoryDescriptions ( &$value, $key )

deleteChannel() публичный Метод

Remove a channel from storage.
public deleteChannel ( array $info )
$info array A channel info array. (@TODO: Look at passing just the id?)

getChannel() публичный Метод

Fetches the requested channel, while actually passing on the request to the backend _getChannel() function to do the real work.
public getChannel ( integer $channel_id ) : array
$channel_id integer The channel id to fetch.
Результат array The channel details as an array

getChannels() публичный Метод

Get a list of stored channels.
public getChannels ( ) : array
Результат array An array of channel hashes.

getChecksum() публичный Метод

public getChecksum ( $story )

getIdBySlug() публичный Метод

public getIdBySlug ( $channel )

getIntervalLabel() публичный Метод

public getIntervalLabel ( $seconds = null )

getStories() публичный Метод

Returns the most recent or all stories from a channel.
public getStories ( integer $criteria, integer $order = Jonah::ORDER_PUBLISHED ) : array
$criteria integer An associative array of attributes on which the resulting stories should be filtered. Examples: 'channel' => (string) Channel slug 'channel_id' => (integer) Channel ID (Either an id or slug is required) 'author' => (string) Story author 'updated-min' => (Horde_Date) Only return stories updated on or after this date 'updated-max' => (Horde_Date) Only return stories updatedon or before this date 'published-min' => (Horde_Date) Only return stories published on or after this date 'published-max' => (Horde_Date) Only return stories published on or before date 'tags' => (array) Tag names that must match to be included 'keywords' => (array) Strings which must match to be included 'published' => (boolean) Whether to return only published stories: Possible values: null return both 'published' returns publised 'unpublished' returns unpublished 'startnumber' => (integer) Story number to start at 'limit' => (integer) Max number of stories
$order integer How to order the results. A Jonah::ORDER_* constant.
Результат array The specified number (or less, if there are fewer) of stories from the given channel.

getStory() публичный Метод

Retrieve the requested story from storage.
public getStory ( integer $story_id, boolean $read = false ) : array
$story_id integer The story id to obtain.
$read boolean Increment the read counter?
Результат array The story information array

getStoryAsMessage() защищенный Метод

Returns the provided story as a MIME part.
protected getStoryAsMessage ( array $story ) : MIME_Part
$story array A data array representing a story.
Результат MIME_Part The MIME message part containing the story parts.

getStoryIdsByChannel() публичный Метод

Return a list of story_ids contained in the specified channel.
public getStoryIdsByChannel ( integer $channel_id ) : array
$channel_id integer The channel_id
Результат array An array of story_ids.

listTagInfo() публичный Метод

public listTagInfo ( $channel_id = null )

renderChannel() публичный Метод

Returns the stories of a channel rendered with the specified template.
public renderChannel ( integer $channel_id, string $tpl, integer $max = 10, integer $from, integer $order = Jonah::ORDER_PUBLISHED ) : string
$channel_id integer The news channel to get stories from.
$tpl string The name of the template to use.
$max integer The maximum number of stories to get. If null, all stories will be returned.
$from integer The number of the story to start with.
$order integer How to sort the results for internal channels Possible values are the Jonah::ORDER_* constants.
Результат string The rendered story listing.

saveStory() публичный Метод

Save the provided story to storage.
public saveStory ( array &$info )
$info array The story information array. Passed by reference so we can add/change the id when saved.

Описание свойств

$_params защищенное свойство

Hash containing connection parameters.
protected array $_params
Результат array