Jonah_Driver:: is responsible for storing, searching, sorting and filtering
locally generated and managed articles. Aggregation is left to Hippo.
Copyright 2002-2012 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.
Methods summary
public
|
#
__construct( array $params = array() )
Constructs a new Driver storage object.
Constructs a new Driver storage object.
Parameters
- $params
- A hash containing connection parameters.
|
public
|
#
deleteChannel( array $info )
Remove a channel from storage.
Remove a channel from storage.
Parameters
- $info
- <p>A channel info array. (@TODO: Look at passing just
the id?)</p>
|
public
array
|
#
getChannel( integer $channel_id )
Fetches the requested channel, while actually passing on the request to
the backend _getChannel() function to do the real work.
Fetches the requested channel, while actually passing on the request to
the backend _getChannel() function to do the real work.
Parameters
- $channel_id
- The channel id to fetch.
Returns
array The channel details as an array
Throws
InvalidArgumentException
|
public
array
|
#
getStories( integer $criteria, integer $order = Jonah::ORDER_PUBLISHED )
Returns the most recent or all stories from a channel.
Returns the most recent or all stories from a channel.
Parameters
- $criteria
- <p>An associative array of attributes on which
the resulting stories should be filtered.
Examples:
'channel' => string Channel slug
'channel_id' => int Channel ID
'author' => string Story author
'updated-min' => Horde_Date Only return
stories updated
on or after this
date
'updated-max' => Horde_Date Only return
stories updated
on 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 Array of tag names ANY of
which may match the story to
be included
'alltags' => array Array of tag names ALL of
which must be associated
with the story to be
included
'keywords' => array Array of strings ALL of
which matching must
include
'published' => boolean Whether to return only
published stories;
null will return both
published and
unpublished
'startnumber' => int Story number to begin
'endnumber' => int Story number to end
'limit' => int Max number of stories</p>
- $order
- <p>How to order the results for internal
channels. Possible values are the
Jonah::ORDER_* constants.</p>
Returns
array The specified number (or less, if there are fewer) of
stories from the given channel.
Throws
InvalidArgumentException
|
public
|
#
saveStory( array & $info )
Save the provided story to storage.
Save the provided story to storage.
Parameters
- $info
- <p>The story information array. Passed by reference so
we can add/change the id when saved.</p>
|
public
array
|
#
getStory( integer $channel_id, integer $story_id, boolean $read = false )
Retrieve the requested story from storage.
Retrieve the requested story from storage.
Parameters
- $channel_id
- The channel id to obtain story from.
- $story_id
- The story id to obtain.
- $read
- Increment the read counter?
Returns
array The story information array
|
public
Horde_Url
|
#
getStoryLink( array $channel, array $story )
Returns the official link to a story.
Returns the official link to a story.
Parameters
- $channel
- A channel hash.
- $story
- A story hash.
Returns
Horde_Url The story link.
|
public
|
|
public
|
|
public
string
|
#
renderChannel( integer $channel_id, string $tpl, integer $max = 10, integer $from = 0, integer $order = Jonah::ORDER_PUBLISHED )
Returns the stories of a channel rendered with the specified template.
Returns the stories of a channel rendered with the specified template.
Parameters
- $channel_id
- The news channel to get stories from.
- $tpl
- The name of the template to use.
- $max
- <p>The maximum number of stories to get. If
null, all stories will be returned.</p>
- $from
- The number of the story to start with.
- $order
- <p>How to sort the results for internal channels
Possible values are the Jonah::ORDER_*
constants.</p>
Returns
string The rendered story listing.
Todo:
This doesn't belong in a storage driver class. Move it to a
view or possible a static method in Jonah::?
|
public
|
#
writeTags( mixed $resource_id, mixed $channel_id, mixed $tags )
Stubs for the tag functions. If supported by the backend, these need
to be implemented in the concrete Jonah_Driver_* class.
Stubs for the tag functions. If supported by the backend, these need
to be implemented in the concrete Jonah_Driver_* class.
Todo:
These will be moved to a new Tagger class and will interface
with the Content_Tagger api.
|
public
|
|
public
|
#
listTagInfo( mixed $tags = array(), mixed $channel_id = null )
|
public
|
|
public
|
|
public
|
|