NAME

MT::Entry - Movable Type entry record


SYNOPSIS

    use MT::Entry;
    my $entry = MT::Entry->new;
    $entry->blog_id($blog->id);
    $entry->status(MT::Entry::RELEASE());
    $entry->author_id($author->id);
    $entry->title('My title');
    $entry->text('Some text');
    $entry->save
        or die $entry->errstr;


DESCRIPTION

An MT::Entry object represents an entry in the Movable Type system. It contains all of the metadata about the entry (author, status, category, etc.), as well as the actual body (and extended body) of the entry.


USAGE

As a subclass of MT::Object, MT::Entry inherits all of the data-management and -storage methods from that class; thus you should look at the MT::Object documentation for details about creating a new object, loading an existing object, saving an object, etc.

The following methods are unique to the MT::Entry interface:

$entry->next

Loads and returns the next entry, where ``next'' is defined as the next record in ascending chronological order (the entry posted after the current entry). entry $entry).

Returns an MT::Entry object representing this next entry; if there is not a next entry, returns undef.

Caches the return value internally so that subsequent calls will not have to re-query the database.

$entry->previous

Loads and returns the previous entry, where ``previous'' is defined as the previous record in ascending chronological order (the entry posted before the current entry $entry).

Returns an MT::Entry object representing this previous entry; if there is not a next entry, returns undef.

Caches the return value internally so that subsequent calls will not have to re-query the database.

$entry->author

Returns an MT::Author object representing the author of the entry $entry. If the author record has been removed, returns undef.

Caches the return value internally so that subsequent calls will not have to re-query the database.

$entry->category

Returns an MT::Category object representing the primary category of the entry $entry. If a primary category has not been assigned, returns undef.

Caches the return value internally so that subsequent calls will not have to re-query the database.

$entry->categories

Returns a reference to an array of MT::Category objects representing the categories to which the entry $entry has been assigned (both primary and secondary categories). If the entry has not been assigned to any categories, returns a reference to an empty array.

Caches the return value internally so that subsequent calls will not have to re-query the database.

$entry->is_in_category($cat)

Returns true if the entry $entry has been assigned to entry $cat, false otherwise.

$entry->comments

Returns a reference to an array of MT::Comment objects representing the comments made on the entry $entry. If no comments have been made on the entry, returns a reference to an empty array.

Caches the return value internally so that subsequent calls will not have to re-query the database.

$entry->comment_count

Returns the number of comments made on this entry.

Caches the return value internally so that subsequent calls will not have to re-query the database.

$entry->archive_file([ $archive_type ])

Returns the name of/path to the archive file for the entry $entry. If $archive_type is not specified, and you are using multiple archive types for your blog, the path is created from the preferred archive type that you have selected. If $archive_type is specified, it should be one of the following values: Individual, Daily, Weekly, Monthly, and Category.


DATA ACCESS METHODS

The MT::Entry object holds the following pieces of data. These fields can be accessed and set using the standard data access methods described in the MT::Object documentation.


DATA LOOKUP

In addition to numeric ID lookup, you can look up or sort records by any combination of the following fields. See the load documentation in MT::Object for more information.


NOTES


AUTHOR & COPYRIGHTS

Please see the MT manpage for author, copyright, and license information.