$_params
$_params : array
Hash containing connection parameters.
Jonah storage implementation for PHP's PEAR database abstraction layer.
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-2017 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.
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.
integer | $channel_id | The channel id to fetch. |
The channel details as an array
getStories(integer $criteria, integer $order = \Jonah::ORDER_PUBLISHED) : array
Returns the most recent or all stories from a channel.
integer | $criteria | 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 |
integer | $order | How to order the results. A Jonah::ORDER_* constant. |
The specified number (or less, if there are fewer) of stories from the given channel.
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.
integer | $channel_id | The news channel to get stories from. |
string | $tpl | The name of the template to use. |
integer | $max | The maximum number of stories to get. If null, all stories will be returned. |
integer | $from | The number of the story to start with. |
integer | $order | How to sort the results for internal channels Possible values are the Jonah::ORDER_* constants. |
The rendered story listing.
saveChannel(array $info) : integer
Saves a channel to the backend.
array | $info | 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. |
The channel ID.