The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Rubric::Entry - a single entry made by a user

VERSION

 $Id: Entry.pm,v 1.19 2005/01/16 03:52:46 rjbs Exp $

DESCRIPTION

This class provides an interface to Rubric entries. It inherits from Rubric::DBI, which is a Class::DBI class.

COLUMNS

 id          - a unique identifier
 link        - the link to which the entry refers
 user        - the user who made the entry
 title       - the title of the link's destination
 description - a short description of the entry
 body        - a long body of text for the entry
 created     - the time when the entry was first created
 modified    - the time when the entry was last modified

RELATIONSHIPS

The link attribute returns a Rubric::Link.

user

The user attribute returns a Rubric::User.

tags

Every entry has_many tags that describe it. The tags method will return the tags, and the entrytags method will return the Rubric::EntryTag objects that represent them.

recent_tags_counted

This method returns a reference to an array of arrayrefs, each a (tag, count) pair for tags used on the week's 50 most recent entries.

INFLATIONS

created

modified

The created and modified columns are stored as seconds since epoch, but inflated to Time::Piece objects.

METHODS

query(\%arg)

The arguments to query provide a set of abstract constraints for the query. These are sent to Rubric::Entry::Query, which builds an SQL query and returns the result of running it. (Either a list or an Iterator is returned.)

(The built-in Class::DBI search method can't handle this kind of search.)

 user   - entries for this User
 tags   - entries with these tags (arrayref)
 link   - entries for this Link
 urimd5 - entries for the Link with this md5 sum
 has_body    - whether entries must have bodies (T, F, or undef)
 has_link    - whether entries must have a link (T, F, or undef)
 (time spec) - {created,modified}_{before,after,on}
               limits entries by time; given as a complete or partial
               time and date string in the form "YYYY-MM-DD HH:MM"

set_new_tags(\@tags)

This method replaces all entry's current tags with the new set of tags.

tags_from_string($taglist)

This (class) method takes a string of tags, delimited by whitespace, and returns a reference to an array of the tags, dropping invalid tags.

Valid tags (shouldn't this be documented somewhere else instead?) may contain letters, numbers, underscores, colons, dots, and asterisks.

TODO

AUTHOR

Ricardo SIGNES, <rjbs@cpan.org>

BUGS

Please report any bugs or feature requests to bug-rubric@rt.cpan.org, or through the web interface at http://rt.cpan.org. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

COPYRIGHT

Copyright 2004 Ricardo SIGNES. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.