PHP 클래스 Jonah_Driver_Sql, horde

The table structure can be created by the scripts/db/jonah_news.sql script. The needed tables are jonah_channels and jonah_stories. Copyright 2002-2015 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.
저자: Marko Djukic ([email protected])
저자: Chuck Hagenbuch ([email protected])
저자: Jan Schneider ([email protected])
저자: Ben Klang ([email protected])
저자: Michael J. Rubinsky ([email protected])
상속: extends Jonah_Driver
파일 보기 프로젝트 열기: horde/horde

보호된 프로퍼티들

프로퍼티 타입 설명
$_connected boolean Boolean indicating whether or not we're connected to the SQL server.
$_db Horde_Db_Adapter_Base Handle for the current database connection.

공개 메소드들

메소드 설명
__construct ( $params = [] )
deleteStory ( $channel_id, $story_id )
getChannelId ( string $channel ) : integer Look up a channel ID by its name
getLatestStoryId ( integer $channel_id ) : integer Gets the latest released story from a given internal channel
getStoryCount ( integer $channel_id ) : integer Returns the total number of stories in the specified channel.
saveChannel ( array &$info ) : integer Saves a channel to the backend.

보호된 메소드들

메소드 설명
_addPermalink ( array &$story ) Adds a missing permalink to a story.
_connect ( ) : boolean Attempts to open a persistent connection to the SQL server.
_convertFromBackend ( array $story ) : array Converts the text fields of a story from the backend charset to the output charset.
_deleteChannel ( integer $channel_id ) : boolean. Remove a channel from storage.
_getChannel ( $channel_id ) : array Retrieve a single channel definition from storage.
_getChannels ( ) : array Get a list of stored channels.
_getIdBySlug ( string $slug ) : integer Obtain a channel id from a slug
_getStories ( array $criteria, $order = Jonah::ORDER_PUBLISHED ) : array Returns a list of stories from the storage backend filtered by arbitrary criteria.
_getStory ( integer $story_id, boolean $read = false ) : The Retrieve a story from storage.
_getStoryIdsByChannel ( $channel_id )
_readStory ( integer $story_id ) Increment the story's read count.
_saveStory ( &$info ) Save a story to storage.
_timestampChannel ( integer $channel_id, integer $timestamp ) : boolean Update the channel's timestamp

메소드 상세

__construct() 공개 메소드

public __construct ( $params = [] )

_connect() 보호된 메소드

Attempts to open a persistent connection to the SQL server.
protected _connect ( ) : boolean
리턴 boolean True on success.

_convertFromBackend() 보호된 메소드

Converts the text fields of a story from the backend charset to the output charset.
protected _convertFromBackend ( array $story ) : array
$story array A story hash.
리턴 array The converted hash.

_deleteChannel() 보호된 메소드

Remove a channel from storage.
protected _deleteChannel ( integer $channel_id ) : boolean.
$channel_id integer The channel to remove.
리턴 boolean.

_getChannel() 보호된 메소드

Retrieve a single channel definition from storage.
protected _getChannel ( $channel_id ) : array
리턴 array The channel definition array.

_getChannels() 보호된 메소드

Get a list of stored channels.
protected _getChannels ( ) : array
리턴 array An array of channel hashes.

_getIdBySlug() 보호된 메소드

Obtain a channel id from a slug
protected _getIdBySlug ( string $slug ) : integer
$slug string The slug to search for.
리턴 integer The channel id.

_getStories() 보호된 메소드

NOTE: $criteria['channel_id'] MUST be set for this method to work.
protected _getStories ( array $criteria, $order = Jonah::ORDER_PUBLISHED ) : array
$criteria array
리턴 array

_getStory() 보호된 메소드

Retrieve a story from storage.
protected _getStory ( integer $story_id, boolean $read = false ) : The
$story_id integer They story id.
$read boolean Increment the read counter?
리턴 The story array.

_getStoryIdsByChannel() 보호된 메소드

protected _getStoryIdsByChannel ( $channel_id )

_readStory() 보호된 메소드

Increment the story's read count.
protected _readStory ( integer $story_id )
$story_id integer The story_id to increment.

_saveStory() 보호된 메소드

Save a story to storage.
protected _saveStory ( &$info )

_timestampChannel() 보호된 메소드

Update the channel's timestamp
protected _timestampChannel ( integer $channel_id, integer $timestamp ) : boolean
$channel_id integer The channel id.
$timestamp integer The new timestamp.
리턴 boolean

deleteStory() 공개 메소드

public deleteStory ( $channel_id, $story_id )

getChannelId() 공개 메소드

Look up a channel ID by its name
public getChannelId ( string $channel ) : integer
$channel string
리턴 integer Channel ID

getLatestStoryId() 공개 메소드

Gets the latest released story from a given internal channel
public getLatestStoryId ( integer $channel_id ) : integer
$channel_id integer The channel id.
리턴 integer The story id.

getStoryCount() 공개 메소드

Returns the total number of stories in the specified channel.
public getStoryCount ( integer $channel_id ) : integer
$channel_id integer The Channel Id
리턴 integer The count

saveChannel() 공개 메소드

Saves a channel to the backend.
public saveChannel ( array &$info ) : integer
$info array The channel to add. Must contain a combination of the following entries:
'channel_id'       If empty a new channel is being added, otherwise one
                   is being edited.
'channel_slug'     The channel slug.
'channel_name'     The headline.
'channel_desc'     A description of this channel.
'channel_interval' If external then interval at which to refresh.
'channel_link'     The link to the source.
'channel_url'      The url from where to fetch the story list.
'channel_image'    A channel image.
리턴 integer The channel ID.

프로퍼티 상세

$_connected 보호되어 있는 프로퍼티

Boolean indicating whether or not we're connected to the SQL server.
protected bool $_connected
리턴 boolean

$_db 보호되어 있는 프로퍼티

Handle for the current database connection.
protected Horde_Db_Adapter_Base $_db
리턴 Horde_Db_Adapter_Base