Help - Search - Members - Calendar
Full Version: Entering a category using MT::Entry Object
Movable Type Community Forum > Additional Resources > Tips and Tricks
imara28
Greetings all!

Using MT::Entry, in addition to creating a new entry, I would like to set the category of that entry, but there doesn't seem to be a way to do this. I am attempting the following:

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

*** this is what I would like to do: ***
$entry->category('Category I want this entry In');

But this doesn't seem to work. It seems to only check if the entry has been assigned a category. I don't want this, I would like to set this category. Should I be using something else? I checked MT::Category, and by the looks of it, only creates categories.

Does anyone know how I can do this? Please let me know if I am not being clear enough....

Thanks in advance!
rayners
MT::Placement is used to associate Entries with Categories.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.