Next:
Yawns::Articles
Previous:
Yawns::Adverts
 [Table of Contents]

Yawns::Article



NAME

Yawns::Article - A module for working with a single article.

SYNOPSIS

    #!/usr/bin/perl -w

    use Yawns::Article;
    use strict;

    my $article = Yawns::Article->new( id => 33 );

    my $count   = $article->getReadCount();

    $article->increaseReadCount();

DESCRIPTION

This module contains code for dealing with a single article.

new

  Create a new instance of this object.

get

  Return the actual article.

  This returns a hash containing all the relevant details of an
 article, along with the titles and IDs of the next and previous
 articles.

edit

  Edit an article:

        my $article = Yawns::Article->new( id => 30 );
        $article->edit( title => "New title",
                        author => "Author",
                        body   => "Body text here" );

create

   Create a new article:

        my $article = Yawns::Article->new( id => 30 );
        $article->create( title => "New title",
                          author => "Author",
                          body   => "Body text here" );

delete

  Delete the given article.

getReadCount

  Return the number of times this article was read.

increaseReadCount

  Add one to the number of times the given article was read.

getTitle

  Get the title of this article.

getLeadText

  Find and return the lead text for a given article.

addRelated

  Add a related link to this particular article.

deleteRelated

  Delete either a single related link, or all the related links on an article.

getRelated

  Return the list of related article links.

_count_words

  Count the words in the given text

invalidateCache

  Clean any cached content we might have.

AUTHOR

Steve Kemp

http://www.steve.org.uk/

LICENSE

Copyright (c) 2005,2006 by Steve Kemp. All rights reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The LICENSE file contains the full text of the license.


[Top] Generated by HTML::FromPod 0.49 on Fri Nov 21 03:03:57 2008