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])
파일 보기 프로젝트 열기: horde/horde 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_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