Bric::Biz::Category

NAME

Bric::Biz::Category - A module to group assets into categories.

VERSION

$LastChangedRevision$

DATE

$LastChangedDate$

SYNOPSIS

# Return a new category object.
my $cat = Bric::Biz::Category->new($init);

# Look up an existing category object.
my $cat = Bric::Biz::Category->lookup({'id' => $cat_id});

# Search for a list of categories.
my @cats = Bric::Biz::Category->list($crit);

# Attribute accessors.
my $id = $cat->get_id;
my $name = $cat->get_name;
$cat = $cat->set_name($name);
my $desc = $cat->get_description;
$cat = $cat->set_description($desc);
my $site_id = $cat->get_site_id;
$cat = $cat->set_site_id($site_id);

# Return a list of child categories of this category.
@cats   = $cat->get_children();
# Return the parent of this category.
$parent = $cat->get_parent();

# Attribute methods.
$val = $element->set_attr($name, $value);
$val = $element->get_attr($name);
$val = $element->set_meta($name, $field, $value);
$val = $element->get_meta($name, $field);

# Ad string methods
$txt = $element->get_ad_string;
$element->set_ad_string($value);
$txt = $element->get_ad_string2;
$element->set_ad_string2($value);

# Add/Delete child categories for this category.
$cat->add_child([$cat || $cat_id]);
$cat->del_child([$cat || $cat_id]);

# Manage keyword associations.
@keys = $cat->get_keywords;
$cat->add_keywords(@keywords);
$cat->del_keywords(@keywords);

# Save information for this category to the database.
$cat->save;

DESCRIPTION

Allows assets to be grouped into categories. In addition to assets a category can contain other categories, allowing a hierarchical layout of categories and assets. New categories will inherit group memberships and asset group permissions from their parents, but those relationships will thereafter be independent of the parent's.

INTERFACE

Constructors

Destructors

Public Class Methods

Public Instance Methods

Private Methods

NONE.

Private Class Methods

NONE

Private Instance Methods

Several that need documenting!

NOTES

NONE.

AUTHOR

Garth Webb

Jeff "japhy" Pinyan

David Wheeler

SEE ALSO

perl, Bric::Util::Grp::Category, Bric, Bric::Biz::Keyword, Bric::Biz::Asset