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

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

Свойство Тип Описание
$_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