Kjetil Kjernsmo > AxKit-App-TABOO-0.52 > AxKit::App::TABOO::Data::Plurals::Comments

Download:
AxKit-App-TABOO-0.52.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Module Version: 0.093   Source  

NAME ^

AxKit::App::TABOO::Data::Plurals::Comments - Data objects to handle multiple Comments in TABOO

DESCRIPTION ^

Usually, you want to retrieve many different comments from the data store, for example all comments below a certain comment. You may use this class to retrieve all comments, comments just below a specified comment or a threaded tree.

Methods

new(@dbconnectargs)

The constructor. Nothing special.

load(what => fields, limit => {key => value, [...]}, orderby => fields)

This load method can be used to retrieve a number of entries from a data store. It uses named parameters, the first what is used to determine which fields to retrieve. It is a string consisting of a commaseparated list of fields, as specified in the data store. The limit argument is to be used to determine which records to retrieve, these will be combined by logical AND. You will most certainly want to supply the sectionid, the storyname and usually the commentpath.

The latter is described in the singular class documentation. It is worth noting that if the commentpath ends with a /, this method will return only the comments on the next level, if it doesn't, it will return the whole tree starting with the given commentpath. If no commentpath is given, a tree of all comments are retrieved.

You may also supply a orderby argument, which is an expression used to determine the order of entries returned. Usually, it would be a simple string with the field name to use, e.g. 'timestamp', but you might want to append the keyword "DESC" to it for descending order. Finally, you may supply a entries argument, which is the maximum number of entries to retrieve.

It will retrieve the data, and then call populate() for each of the records retrieved to ensure that the plural data objects actually consists of an array of AxKit::App::TABOO::Data::Comments.

If there is no data that corresponds to the given arguments, this method will return undef.

adduserinfo

This methods is implemented in a plurals context, and can be called on a plurals object just like a singular object. Each entry will have their data structure extended with user information.

exist(commentpath => '/foo', storyname => 'story', sectionid => 'section')

This method can be used to check if there are one or more comments starting with the commentpath given. It takes a hash to identify the comment. It will return a scalar with the number of found comments.

BUGS/TODO ^

It might be a good idea to return just a singular type object if there is indeed just a single object that is returned from load.

FORMALITIES ^

See AxKit::App::TABOO.

syntax highlighting: