NAME
AxKit::App::TABOO::Data::Plurals::Stories - Data objects to handle multiple Stories in TABOO
DESCRIPTION
Often, you want to retrieve many different stories from the data store, for example all belonging to a certain category or a certain section. This is a typical situation where this class shoule be used.
Methods
new(@dbconnectargs)
-
The constructor. Nothing special.
load(what => fields, limit => {key => value, [...]}, orderby => fields, entries => number)
-
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. Thelimit
argument is to be used to determine which records to retrieve, these will be combined by logical AND. You may also supply aorderby
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 aentries
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::Storys. But it calls the internal_load()
-method to do the hard work (and that's in the parent class).If there is no data that corresponds to the given arguments, this method will return
undef
. addcatinfo
adduserinfo
-
These two methods are 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 and category information.
exists(key => value, [...])
-
This checks if there exists a story with the limits specified as a hash, by the template of the
limit
argument of theload
method.It will return the number of such stories.
BUGS/TODO
Not anything particular at the moment...
FORMALITIES
See AxKit::App::TABOO.